Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject
2017-08-18 16:59
573 查看
http://blog.csdn.net/ithouse/article/details/71248820http://blog.csdn.net/ithouse/article/details/71248820
出现这个错误一般是在高版本的AndroidStudio里导入旧版本的gradle项目,需要:
1. 打开build.gradle(Project :)文件,修改classpath为(如果不知道应该修改为多少,请新建一个项目,参考新建项目里的classpath):
classpath 'com.android.tools.build:gradle:2.3.1'
打开gradle/wrapper/gradle-wrapper.properties文件,修改distributionUrl为
distributionUrl=http://services.gradle.org/distributions/gradle-3.3-all.zip
或本地相关distribution,然后重试。遇到下载很慢的情况,请手动下载相关distribution,复制到如下目录即可。
C:\Users\Jason\.gradle\wrapper\dists\gradle-3.3-all\对应文件夹\
如遇到类似如下错误:
Error:Execution failed for task ':transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: C:\AppsBackup\libs\jackson-annotations-2.4.0.jar
File2: C:\AppsBackup\libs\jackson-core-2.4.0.jar
File3: C:\AppsBackup\libs\jackson-databind-2.4.0.jar
则在gradle文件的Android节点下添加如下信息:
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
出现这个错误一般是在高版本的AndroidStudio里导入旧版本的gradle项目,需要:
1. 打开build.gradle(Project :)文件,修改classpath为(如果不知道应该修改为多少,请新建一个项目,参考新建项目里的classpath):
classpath 'com.android.tools.build:gradle:2.3.1'
打开gradle/wrapper/gradle-wrapper.properties文件,修改distributionUrl为
distributionUrl=http://services.gradle.org/distributions/gradle-3.3-all.zip
或本地相关distribution,然后重试。遇到下载很慢的情况,请手动下载相关distribution,复制到如下目录即可。
C:\Users\Jason\.gradle\wrapper\dists\gradle-3.3-all\对应文件夹\
如遇到类似如下错误:
Error:Execution failed for task ':transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE
File1: C:\AppsBackup\libs\jackson-annotations-2.4.0.jar
File2: C:\AppsBackup\libs\jackson-core-2.4.0.jar
File3: C:\AppsBackup\libs\jackson-databind-2.4.0.jar
则在gradle文件的Android节点下添加如下信息:
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
相关文章推荐
- 解决Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- 解决Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject
- Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- 解决Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Could not determine the class-path for interface com.android.builder.model.AndroidProject
- Error:Could not determine the class-path for interface com.android.builder.model.NativeAndroidProjec
- Could not determine the class-path for interface com.android.builder.model.NativeAndroidProjec
- idea Could not determine the class-path for interface org.jetbrains.kotlin.gradle.KotlinGradleModel.
- Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
- Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
- Error:Unable to resolve dependency for ':app@stage/compileClasspath': Could not resolve project :mvp
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- JAVA Error:The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry.....
- JAVA Error:The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry.....
- The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build pat
- droiddraw - DroidDraw is a graphical user interface (GUI) builder for the Android platform - Google Project Hosting
- Vitamio 导入依赖库出错 :Error:(9, 0) Could not get unknown property 'ANDROID_BUILD_SDK_VERSION' for project