使用Android Studio 3.3 Canary 11和gradle插件版本3.3.0-Alpha11.尝试同步gradle时,它会引发以下错误
WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativebuildproviders()'.It will be removed at the end of 2019.For more information, see https://d.androID.com/r/tools/task-configuration- avoIDanceAffected Modules: app
单击错误会将我引导至gradle文件中的此行
applicationVariants.all { variant -> variant.outputs.all { outputfilename = "${variant.name}-${variant.versionname}.apk" } }
我到底需要改变什么?
project build.gradle
// top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositorIEs { jcenter() mavenCentral() // jcenter() works as well because it pulls from Maven Central maven { url "https://maven.Google.com" } Google() } dependencIEs { classpath 'com.androID.tools.build:gradle:3.3.0-Alpha11' // NOTE: Do not place your application dependencIEs here; they belong // in the indivIDual module build.gradle files classpath "io.realm:realm-gradle-plugin:4.1.1" classpath 'com.Google.gms:Google-services:3.2.1' classpath 'com.Google.firebase:firebase-plugins:1.1.5' }}allprojects { repositorIEs { jcenter() maven { url "https://maven.Google.com" } }}task clean(type: Delete) { delete rootProject.buildDir}// define versions in a single placeext { // Sdk and tools minSdkVersion = 21 targetSdkVersion = 27 compileSdkVersion = 27 buildToolsversion = '27.0.3' // App dependencIEs supportlibraryVersion = '27.1.1' appCompactlibraryVersion = '27.1.1' playServicesversion = '15.0.1' firebaseVersionCore = '16.0.1' firebaseVersionPerf = '16.0.0' firebaseVersionMessaging = '17.1.0' //lottIE lottIEVersion = '2.5.0'}
app build.gradle
buildscript { repositorIEs { maven { url 'https://maven.fabric.io/public' } } dependencIEs { classpath 'io.fabric.tools:gradle:1.25.4' } buildscript { repositorIEs { maven { url "https://maven.Google.com" } maven { url 'https://maven.fabric.io/public' } mavenCentral() } dependencIEs { // These docs use an open ended version so that our plugin // can be updated quickly in response to AndroID tooling updates // We recommend changing it to the latest version from our changelog: // https://docs.fabric.io/androID/changelog.HTML#fabric-gradle-plugin classpath 'io.fabric.tools:gradle:' } }}apply plugin: 'com.androID.application'apply plugin: 'com.Google.firebase.firebase-perf'repositorIEs { maven { url 'https://maven.fabric.io/public' }}apply plugin: 'io.fabric'apply plugin: 'realm-androID'androID { realm { syncEnabled = false } dexOptions { javaMaxHeapSize "4g" } compileSdkVersion rootProject.ext.compileSdkVersion defaultConfig { applicationID "example.com" minSdkVersion rootProject.ext.minSdkVersion multIDexEnabled true versionCode mVersionCode versionname mVersionname vectorDrawables.useSupportlibrary = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } buildTypes { applicationVariants.all { variant -> variant.outputs.all { outputfilename = "${variant.name}-${variant.versionname}.apk" } } release { shrinkResources true MinifyEnabled true useProguard true proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' lintoptions { disable 'MissingTranslation' } applicationVariants.all { variant -> variant.outputs.all { outputfilename = "${variant.name}-${variant.versionname}.apk" } } } deBUG { shrinkResources true MinifyEnabled true useProguard true deBUGgable true versionnameSuffix '-DEBUG' proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'deBUG-proguard-rules.pro' ext.enableCrashlytics = false crunchPngs false } } flavorDimensions "default" lintoptions { checkReleaseBuilds false } 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' } buildToolsversion '28.0.2'}configurations { implementation.exclude group: "org.apache.httpcomponents", module: "httpclIEnt"}dependencIEs { implementation filetree(include: ['*.jar'], dir: 'libs') implementation "com.androID.support:appcompat-v7:$rootProject.appCompactlibraryVersion" implementation "com.androID.support:support-compat:$rootProject.supportlibraryVersion" implementation "com.androID.support:mediarouter-v7:$rootProject.supportlibraryVersion" implementation "com.androID.support:cardvIEw-v7:$rootProject.supportlibraryVersion" implementation "com.androID.support:design:$rootProject.supportlibraryVersion" API 'com.squareup.retrofit2:retrofit:2.4.0' API 'com.squareup.okhttp3:okhttp:3.11.0' API 'com.squareup.okhttp3:logging-interceptor:3.10.0' implementation 'com.Google.code.gson:gson:2.8.2' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0' implementation 'com.androID.support:multIDex:1.0.3' implementation 'com.daimajia.easing:library:2.0@aar' implementation 'com.daimajia.androIDanimations:library:2.3@aar' implementation 'com.akexorcist:Googledirectionlibrary:1.0.5' implementation 'io.reactivex:rxandroID:1.2.1' implementation 'io.reactivex:rxjava:1.3.0' // Wifi hotspot library implementation 'cc.mvdan.accesspoint:library:0.2.0' implementation 'com.androID.support.constraint:constraint-layout:1.1.3' implementation 'org.Jsoup:Jsoup:1.10.3' API "com.airbnb.androID:lottIE:$rootProject.lottIEVersion" implementation 'com.androID.support:support-v4:27.1.1' implementation 'com.androID.support:recyclervIEw-v7:27.1.1' testImplementation 'junit:junit:4.12' implementation 'com.jakewharton:butterknife:8.8.1' deBUGImplementation 'com.squareup.leakcanary:leakcanary-androID:1.5.4' releaseImplementation 'com.squareup.leakcanary:leakcanary-androID-no-op:1.5.4' implementation 'com.Googlecode.libphonenumber:libphonenumber:8.2.0' implementation "com.Google.androID.gms:play-services-base:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-cast-framework:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-auth:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-IDentity:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-awareness:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-cast:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-drive:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-location:$rootProject.playServicesversion" implementation "com.Google.androID.gms:play-services-maps:$rootProject.playServicesversion" implementation "com.Google.firebase:firebase-core:$rootProject.firebaseVersionCore" implementation "com.Google.firebase:firebase-perf:$rootProject.firebaseVersionPerf" implementation "com.Google.firebase:firebase-messaging:$rootProject.firebaseVersionMessaging" implementation "com.Google.firebase:firebase-analytics:$rootProject.firebaseVersionCore" API('com.crashlytics.sdk.androID:crashlytics:2.8.0@aar') { transitive = true } API('com.crashlytics.sdk.androID:answers:1.4.1@aar') { transitive = true } annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' API project(path: ':libraryBTHelper') API project(':bkk_rush') deBUGAPI 'com.amitshekhar.androID:deBUG-db:1.0.3' API "org.jdeferred:jdeferred-androID-aar:1.2.6" implementation 'com.androID.support:grIDlayout-v7:27.1.1'}apply plugin: 'com.Google.gms.Google-services'
我在app / build.gradle文件中跳过了一些常量和其他敏感信息.
解决方法:
该问题已在最新版本“io.fabric.tools:gradle:1.30.0”中修复
请使用1.30.0更新您的两个gradle结构工具
buildscript { // ... repositorIEs, etc. ... dependencIEs { // ...other dependencIEs ... classpath 'io.fabric.tools:gradle:1.30.0' }}
有关详细信息https://github.com/firebase/firebase-android-sdk/issues/198#issuecomment-473435453
总结以上是内存溢出为你收集整理的android – API’variable.getExternalNativeBuildTasks()’已过时,已替换为’variant.getExternalNativeBuildProvid全部内容,希望文章能够帮你解决android – API’variable.getExternalNativeBuildTasks()’已过时,已替换为’variant.getExternalNativeBuildProvid所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)