Android Studio 3.0 – 对于externalNativeBuild,Gradle Sync失败

Android Studio 3.0 – 对于externalNativeBuild,Gradle Sync失败,第1张

概述当我迁移到 Android studio 3.0时,我得到以下回溯 * What went wrong:Could not determine the dependencies of task ':celltower:compileExternalNativeBuildJavaWithJavac'.> Could not resolve all task dependencies for co 当我迁移到 Android studio 3.0时,我得到以下回溯
* 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')}

任何帮助深表感谢!

解决方法 我移出了buildTypes之外的externalNativeBuild并将它放在androID下.它开始工作了.
androID {.......   buildTypes {        release {            MinifyEnabled false            proguardfiles getDefaultProguardfile('proguard-androID.txt'),"x86"                modulename "HelloJNI"            }        }    }    externalNativeBuild {        ndkBuild {            path "src/main/jni/AndroID.mk"        }    }    buildTypeMatching 'deBUG','release'.......} // end of androID
总结

以上是内存溢出为你收集整理的Android Studio 3.0 – 对于externalNativeBuild,Gradle Sync失败全部内容,希望文章能够帮你解决Android Studio 3.0 – 对于externalNativeBuild,Gradle Sync失败所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1138810.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-31
下一篇2022-05-31

发表评论

登录后才能评论

评论列表(0条)

    保存