android - Android Studio 2.0 Gradle Project使用gradle:2.0.0无法成功构建

标签 android android-studio gradle

我正在开发一个Gradle Sync时有一些问题的应用程序。

这是我的Gradle Log

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a`enter code here`
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
 Error:and without specifying any "-target" type options. The consequence of ignoring
 Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.eclipse.paho.client.mqttv3.persist.MqttDefaultFilePersistence$2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.

这是我的Build.Gradle
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3.2'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'
    defaultConfig {
        applicationId "com.mike.shopass"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 12
        versionName '1.7.0'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile files('libs/afinal.jar')
    compile files('libs/android-support-v4.jar')
    compile files('libs/base64 1.1.jar')
    compile files('libs/com.baidu.speechsynthesizer_1.1.1.jar')
    compile files('libs/galaxy_lite.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/slidingmenu.jar')
    compile files('libs/swipeistview.jar')
    compile files('libs/umeng-analytics-v5.2.4.jar')
    compile files('libs/universal-image-loader-1.9.3-with-sources.jar')
    compile files('libs/zxing.jar')
    compile files('libs/org.eclipse.paho.android.service-1.0.3.jar')
    compile files('libs/org.eclipse.paho.client.mqttv3-1.0.3.jar')
    debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
    //    compile 'com.alipay.euler:andfix:0.3.1@aar'
    compile 'me.grantland:autofittextview:0.2.+'
    //    compile 'com.yalantis:ucrop:1.3.+'
    compile 'com.orhanobut:logger:1.3'
}


apt {


    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile

        resourcePackageName 'com.mike.shopass'

    }
}

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        // replace with the current version of the Android plugin
        classpath 'com.android.tools.build:gradle:2.0.0'
        // replace with the current version of the android-apt plugin
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}



repositories {
    mavenCentral()
    mavenLocal()
}

最佳答案

更新Android Studio并更新以下参数。再见,再见

android {
    compileSdkVersion 24
    buildToolsVersion '24.0.0'

 compile('org.eclipse.paho:org.eclipse.paho.android.service:1.0.2') {
        exclude module: 'support-v4'
    }
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2'

关于android - Android Studio 2.0 Gradle Project使用gradle:2.0.0无法成功构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36661193/

相关文章:

java - 下载 Gradle 时 Ionic 构建 Android 错误

android - 在 android 中使用 CheckedTextView 需要帮助

java - 如何将github库包含到Android Studio项目中

android - 在android studio中切换主题时防止重启应用程序

Android 切换到 gradle 不编译 JRE7 代码特性

android - ContentProvider 中的内部子选择?

android - 创建 cutomView 时不添加View?

android - 如何通过将其他对象字段保存为索引来按对象字段对 MutableMap 进行排序?

java - 为什么使用 jdk 14 LibGDX 构建失败

gradle - Gradle 。检测依赖问题