我不会在我的项目中实现此设计库>https://developer.android.com/topic/libraries/support-library/packages.html#design(com.android.support:design:28.0.0)。但是,当我同步时,我得到了一个错误:无法获得类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的对象的未知属性'com'。请帮忙。谢谢:)
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.pyramid"
minSdkVersion 15
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'])
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 'com.google.android.material:material:1.1.0'
implementation 'com.android.support.design:28.0.0'
好吧,我认为已经解决了。我只是将所有库从带有Bottom Navigation Activity
的第二个项目复制到了我的第一个项目。全部都是:)