【发布时间】:2018-10-11 10:34:40
【问题描述】:
我从 Eclipse 导入了项目,我遇到了很多错误,我现在在成功构建后最终解决了所有问题,我收到了错误:
找不到 com.google.dagger:dagger-compiler:3.0.0
build.gradle(project) 中的代码是
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
build.gradle(module:app) 中的代码是
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.thanu.schoolbustracker"
minSdkVersion 24
targetSdkVersion 27
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
annotationProcessor 'com.google.dagger:dagger-compiler:3.0.0'
compile 'com.android.support:support-v4:27.0.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile files('libs/google-play-services.jar')
compile files('libs/maps.jar')
compile 'com.android.support:support-annotations:27.0.2'
compile 'com.android.support:support-v13:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
compile 'com.android.support:support-vector-drawable:27.0.2'
compile 'com.android.support:design:27.0.2'
compile 'com.android.support:gridlayout-v7:27.0.2'
compile 'com.android.support:mediarouter-v7:27.0.2'
compile 'com.android.support:cardview-v7:27.0.2'
compile 'com.android.support:palette-v7:27.0.2'
compile 'com.android.support:leanback-v17:27.0.2'
compile 'com.android.support:recyclerview-v7:27.0.2'
compile 'com.android.support:exifinterface:27.0.2'
compile 'com.android.support.constraint:constraint-layout:1.1.0'
compile 'com.android.support.test:runner:1.0.1'
compile 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.android.support.test.espresso:espresso-contrib:3.0.2'
compile 'com.android.databinding:library:3.1.2'
compile 'com.android.databinding:baseLibrary:3.1.2'
compile 'com.android.databinding:compiler:3.1.2'
compile 'com.android.databinding:adapters:3.1.2'
compile 'com.google.android.gms:play-services-ads:15.0.0'
compile 'com.google.android.gms:play-services-wearable:15.0.0'
compile 'com.google.android.gms:play-services-maps:15.0.0'
compile 'com.google.android.support:wearable:2.3.0'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
rebuild后,项目构建成功,但没有创建APK并报错;
找不到 com.google.dagger:dagger-compiler:3.0.0
【问题讨论】:
标签: android eclipse android-gradle-plugin dagger-2