• Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject


    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:UsersJason.gradlewrapperdistsgradle-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:AppsBackuplibsjackson-annotations-2.4.0.jar
    File2: C:AppsBackuplibsjackson-core-2.4.0.jar
    File3: C:AppsBackuplibsjackson-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'
    }

  • 相关阅读:
    易用性问题回复
    阅读心得2:《余额宝技术架构及演进 》
    假期周进度报告8
    假期周进步报告7
    假期周进度报告6
    假期周进度报告5
    假期周进度报告4
    假期周进度报告3
    JAVA中SSH框架
    一张图说明CDN网络的原理
  • 原文地址:https://www.cnblogs.com/bluestorm/p/7390670.html
Copyright © 2020-2023  润新知