2017-08-13 17 views
7

के लिए असफल जब मैं एंड्रॉयड स्टूडियो की ओर पलायन कर रहा हूँ मैं जो निम्नलिखित ट्रैसबैक हो रही है 3,0एंड्रॉयड स्टूडियो 3.0 - Gradle सिंक externalNativeBuild

* What went wrong: 
Could not determine the dependencies of task ':celltower:compileExternalNativeBuildJavaWithJavac'. 
> Could not resolve all task dependencies for configuration ':celltower:externalNativeBuildCompileClasspath'. 
    > Could not resolve project :commonandroidutils. 
    Required by: 
     project :celltower 
     > Unable to find a matching configuration of project :commonandroidutils: 
      - Configuration 'debugApiElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'debug'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. 
      - Configuration 'debugRuntimeElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'debug'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. 
      - Configuration 'releaseApiElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'release'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. 
      - Configuration 'releaseRuntimeElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'release'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. 
    > Could not resolve project :wimtutils. 
    Required by: 
     project :celltower 
     > Unable to find a matching configuration of project :wimtutils: 
      - Configuration 'debugApiElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'debug'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. 
      - Configuration 'debugRuntimeElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'debug'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. 
      - Configuration 'releaseApiElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'release'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'. 
      - Configuration 'releaseRuntimeElements': 
       - Required com.android.build.api.attributes.BuildTypeAttr 'externalNativeBuild' and found incompatible value 'release'. 
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'. 
       - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. 
       - Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'. 

मेरे build.gradle यहाँ है।

apply plugin: 'com.android.library' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 

    defaultConfig { 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 

     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     externalNativeBuild { 
      ndkBuild { 
      } 
     } 

     ndk { 
//   abiFilters "armeabi-v7a", "x86" 
      abiFilters "armeabi-v7a" 
      moduleName "HelloJNI" 
      //ldLibs.addAll(["android", "log"]) 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
     debug { 
      debuggable true 
      minifyEnabled false 

      ndk { 
       abiFilters "armeabi-v7a", "x86" 
       moduleName "HelloJNI" 
      } 
     } 
     externalNativeBuild { 
      ndkBuild { 
       path "src/main/jni/Android.mk" 
      } 
     } 
    } 

    buildTypeMatching 'debug', 'release' 

    compileOptions { 
     targetCompatibility 1.8 
     sourceCompatibility 1.8 
    } 
} 

ext { 
    retrofitVersion = '2.1.0' 
    rxJavaVersion = '1.2.1' 
    rxAndroidVersion = '1.2.1' 
    okHttpVersion = '3.4.1' 
    playServicesVersion = '9.8.0' 
    fireBaseVersion = '9.8.0' 
    daggerVersion = '2.7' 
    appCompatV7Version = '26.0.1' 
} 

dependencies { 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    implementation "com.android.support:support-annotations:$appCompatV7Version" 
    implementation 'com.google.code.gson:gson:2.7' 
    testImplementation 'junit:junit:4.12' 
    implementation 'com.squareup.retrofit:retrofit:1.9.0' 
    implementation 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.0.2' 
    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" 
    implementation "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" 
    implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion" 
    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' 
    implementation project(':commonandroidutils') 
    implementation project(':wimtutils') 
} 

किसी भी मदद की बहुत सराहना की जाती है!

उत्तर

2

मैंने बिल्डटाइप के बाहर बाहरीनेटिव बिल्ड को बाहर निकाला और इसे एंड्रॉइड के नीचे रखा है। यह काम करना शुरू कर दिया।

android { 
.... 
... 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
     debug { 
      debuggable true 
      minifyEnabled false 

      ndk { 
       abiFilters "armeabi-v7a", "x86" 
       moduleName "HelloJNI" 
      } 
     } 
    } 

    externalNativeBuild { 
     ndkBuild { 
      path "src/main/jni/Android.mk" 
     } 
    } 

    buildTypeMatching 'debug', 'release' 
... 
.... 
} // end of android 
0

कोशिश केवल पिछले दो परियोजना निर्भरता के लिए api साथ implementation की जगह:

  1. commonandroidutils
  2. wimutils

प्रलेखन कहा गया है कि:

निर्भरता संकलन पर मॉड्यूल के लिए उपलब्ध है समय, और यह संकलन समय और रनटाइम पर मॉड्यूल के उपभोक्ता के लिए भी उपलब्ध है। यह कॉन्फ़िगरेशन compile (जिसे अब बहिष्कृत किया गया है) की तरह व्यवहार करता है, और आपको आमतौर पर इसे केवल लाइब्रेरी मॉड्यूल में उपयोग करना चाहिए। ऐप मॉड्यूल implementation का उपयोग करना चाहिए, जब तक कि आप अपने एपीआई को एक अलग परीक्षण मॉड्यूल में बेनकाब नहीं करना चाहते हैं।

संदर्भ: Migrate to Android Plugin for Gradle 3.0.0

सुनिश्चित नहीं हैं, लेकिन इसे आजमाइए। आशा करता हूँ की ये काम करेगा।

0

मुझे यकीन नहीं है कि यह कैसे संभव है। ऐसा लगता है कि आपके पास ग्रैडल प्लगइन और इसकी निर्भरताओं के बीच एक मेल नहीं है जो WaitableExecutor क्लास प्रदान करता है।

हालांकि आप ग्रैडल 1.5 का उल्लेख करते हैं और यह एक समस्या है।

प्लगइन संस्करण 0.3 पिछले सप्ताह Gradle 1.3-1.4 नए संस्करण के रिलीज के साथ संगत किया गया था, 0.4 Gradle के साथ संगत 1.6+

आप 0.4 का उपयोग सुनिश्चित करें और नए Gradle संस्करण बनाने है।

संबंधित मुद्दे