3

Android Studioをバージョン2.0(安定版)にアップデートすると、プロジェクトのGradle同期が壊れています。Android Studio 2.0は、gradle-experimentalプラグインでndkビルドを中断します

エラーポップアップ:

Android Gradle Plugin Update Required 

The project is using an incompatible version of the Android Gradle plugin. 

To configure the project, the IDE will update the Android Gradle Plugin to version 2.0.0. 

You can learn more about this version of the plugin from this [release notes][1]. 

-> Update -> Cancel and update manually 

Gradleの同期問題(メッセージで表示):

Error:The project is using an incompatible version of the Android Gradle plugin. 
Please update your project to use version 2.0.0. 
-> Search in build.gradle files 

それが持っていると私はNDKビルドのGradleの実験的プラグイン(classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha5')を使用しています推奨されている、例えばhere、これ私のbuild.gradleは(com.android.model.applicationプラグインで)次のようになり、私はclasspath 'com.android.tools.build:gradle:2.0.0'、単に「更新」することはできません。

apply plugin: 'com.android.model.application' 

def superpowered_path = file('.').absolutePath + "/src/main/jni/Superpowered" 

model { 

    repositories { 
     libs(PrebuiltLibraries) { 
      superpowered { 
       headers.srcDir "${superpowered_path}" 
       binaries.withType(StaticLibraryBinary) { 
        staticLibraryFile = file("${superpowered_path}/lib/${targetPlatform.getName()}/libSuperpoweredAndroid.a") 
       } 
      } 
     } 
    } 

    android { 
     compileSdkVersion 23 
     buildToolsVersion "23.0.3" 

     defaultConfig { 
      applicationId "APPID" 
      minSdkVersion.apiLevel 15 
      targetSdkVersion.apiLevel 23 
      versionCode 1 
      versionName "1.0" 

      archivesBaseName = "APPNAME-$versionCode-$versionName" 

      renderscriptTargetApi 20 
      renderscriptSupportModeEnabled true 
     } 

     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles.add(file('proguard-rules.pro')) 
       signingConfig = $("android.signingConfigs.releaseSigning") 
      } 
      debug { 
       applicationIdSuffix ".debug" 
       versionNameSuffix "-DEBUG" 
       signingConfig = $("android.signingConfigs.debugSigning") 
      } 
     } 

     sources { 
      main { 
       jni { 
        dependencies { 
         library "superpowered" linkage "static" 
        } 
       } 
      } 
     } 

     /* 
     * native build settings 
     */ 
     ndk { 
      moduleName = "NDKMODULE-jni" 
      cppFlags.add("-std=c++11") 
      ldLibs.addAll(["android", "log", "OpenSLES"]) 
      abiFilters.addAll(["armeabi-v7a", "x86", "arm64-v8a"]) 
     } 
    } 

    android.signingConfigs { 
     create("releaseSigning") { 
      keyAlias 'release' 
      keyPassword 'PASSWORD' 
      storeFile file('KEYSTORE.jks') 
      storePassword 'PASSWORD' 
      storeType "jks" 
     } 
     create("debugSigning") { 
      keyAlias 'debug' 
      keyPassword 'PASSWORD' 
      storeFile file('KEYSTORE.jks') 
      storePassword 'PASSWORD' 
      storeType "jks" 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar', '*.a']) 
    testCompile 'junit:junit:4.12' 

    // Android support libs 
    compile 'com.android.support:appcompat-v7:23.2.1' 
    compile 'com.android.support:design:23.2.1' 
    compile 'com.android.support:support-v4:23.2.1' 
    compile 'com.android.support:recyclerview-v7:23.2.1' 

    // Android Async Http 
    // Apache 2.0 http://loopj.com/android-async-http/ 
    compile 'com.loopj.android:android-async-http:1.4.9' 

    // OkHttp http://square.github.io/okhttp/ 
    // Apache v2 
    compile 'com.squareup.okhttp3:okhttp:3.2.0' 

    // Picasso http://square.github.io/picasso/ 
    // Apache v2 
    compile 'com.squareup.picasso:picasso:2.5.2' 

    // Retrofit http://square.github.io/retrofit/ 
    // Apache v2 
    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' 
} 

カナリア/ベータビルドについて私は、Android Studioの2.0の問題に見つけることができるすべてでしたこれとは別の問題があるようです。 更新の前に、Gradleの同期が正常に機能しました。 (私は最後の安定したビルドを使用していました、1.5.1と思いますか?)

Androidスタジオ2.0でndkを使用する方法についていくつかのアイデアを期待しています。私のために0.7.0-アルファ1の固定のGradle同期:Gradleの実験的使用

答えて

2

クラスパスについては、以下を使用して classpath 'com.android.tools.build:gradle-experimental:0.7.0-alpha1'

+0

エラー:com.android.tools.build:gradle-experimental:0.7.0-alpha1が見つかりませんでした。 エラーです。他の場所でも変更する必要がありますか? – jclova

+0

プロジェクトのbuild.gradleでのみ変更する必要があります –

0

は私のために問題を修正しました。

classpath 'com.android.tools.build:gradle-experimental:0.7.0' 
関連する問題