- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在下面的 YouTube 视频的帮助下构建一个位置跟踪器应用程序。
"https://www.youtube.com/watch?v=17HqLBkuX-E "
在 build.gradle 模块中,我已将 CardView 和 recyclerview 行替换为视频中的行,因为它们用红色下划线表示“根据 android 进行更改”。所以这些是我用于cardview和recyclerview的代码
androidx.cardview.widget.CardView
implementation 'androidx.recyclerview:recyclerview:1.0.0'
<androidx.recyclerview.widget.RecyclerView
.
.
.
</androidx.recyclerview.widget.RecyclerView>
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.recyclerview.widget.RecyclerView>
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven{
url "https://maven.google.com"
}
maven{
url "https://maven.fabric.io/public"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.locationtracker2019"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidx.cardview.widget.CardView
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation "com.google.firebase:firebase-database:10.2.0"
implementation "com.google.firebase:firebase-auth:10.2.0"
implementation "com.firebaseui:firebase-ui-auth:1.2.0"
implementation "com.firebaseui:firebase-ui-database:1.2.0"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
最佳答案
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
关于android - 无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象获取未知属性 'androidx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59475842/
我收到以下错误 Could not get unknown property 'supportLibVersion' for object of type org.gradle.api.interna
我正在为新的 android-kotlin 项目添加新的依赖项,但在同步项目后出现以下错误。 Could not set unknown property 'implementation' for o
我正在尝试在下面的 YouTube 视频的帮助下构建一个位置跟踪器应用程序。 "https://www.youtube.com/watch?v=17HqLBkuX-E " 在 build.gradle
在 build.gradle 文件中添加了以下依赖项,用于在我的新 Kotlin 项目中实现 Retrofit API 调用。 implementation "com.squareup.okh
我试图添加导航依赖项以在我的项目中使用导航图,并且 android studio 抛出了此错误。 这是我的项目 Gradle 文件: // Top-level build file where you
我正在尝试重新组织这个Android (Java based) library使用buildSrc文件夹来定义所有版本和依赖项,如本 article 中所述。 . 我已经为 Kotlin 基础项目成功
我在我的 android 项目中添加了一个外部库。 gradle sync 后出现以下错误: 错误:无法为类型为 org.gradle.api.internal.artifacts.dsl.depen
我已经搜索了上一篇文章,但找不到问题的答案,这是我的 build.gradle 文件中的代码。 错误:评估项目“:app”时出现问题。 Could not get unknown property '
我正在为 Android 设备构建 Ionic 应用程序。我的 gradle 版本是 3.3。我是这个 Android 建筑的新手。我收到以下错误: Build file 'E:\FarmApp\sm
我正要添加谷歌地图 Activity ,我的 android studio 显示这个错误 Error:Error:line (25)Could not get unknown property 'co
我需要在我的 android 上运行我通过“yarn android”生成的应用程序,但是当我尝试出错时,并且在 android-studio 中打开我的应用程序的 android 文件夹时,会出现此
我是一名优秀的程序员,十分优秀!