2

I didn't call variant.getAssemble() from my project but still showing these messages. When I try to run the project I get this error "Manifest Merger failed with multiple errors in Android Studio "

'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.

Gradle.build file is here, I don't use variant.getAssemble() here. If the system is calling this then where can I find it to solve the issue. I have multiple modules.

apply plugin: 'com.android.application'

apply plugin: 'com.google.firebase.firebase-crash'

dependencies {

implementation project(':A')
implementation project(':B')
implementation project(':C')
implementation project(':D')
//implementation project(':E')
implementation project(':F')
implementation project(':G')

implementation "com.android.support:appcompat-v7:$project.supportVersion"
implementation "com.android.support:support-v4:$project.supportVersion"
implementation "com.android.support:cardview-v7:$project.supportVersion"
implementation "com.android.support:recyclerview-v7:$project.supportVersion"
implementation "com.android.support:design:$project.supportVersion"
implementation "com.android.support:support-v13:$project.supportVersion"
implementation "com.android.support:support-vector-drawable:$project.supportVersion"

implementation "com.google.firebase:firebase-core:$project.firebaseCore"
implementation "com.google.firebase:firebase-ads:$project.firebaseAds"
implementation "com.google.firebase:firebase-auth:$project.firebaseAuth"
implementation "com.google.firebase:firebase-messaging:$project.firebaseMessaging"
implementation "com.google.firebase:firebase-crash:$project.firebaseCrash"

implementation "com.google.code.gson:gson:$project.gsonVersion"
implementation "com.google.guava:guava:$project.guavaVersion"
implementation "org.jsoup:jsoup:$project.jsoupVersion"
implementation "ch.acra:acra:$project.acraVersion"
implementation "com.mcxiaoke.volley:library:$project.volleyVersion"
// optional

debugImplementation "com.squareup.leakcanary:leakcanary-android:$project.leackcanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$project.leackcanaryVersion"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$project.leackcanaryVersion"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.squareup.retrofit2:retrofit:$project.RetrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$project.RetrofitGsonVersion"
}

android {

defaultConfig {
    applicationId "com.XXX.XXXX"
    multiDexEnabled = true
    vectorDrawables.useSupportLibrary = true
}

android.applicationVariants.all { variant ->
    variant.outputs.all { output ->
        def relativeRootDir = output.packageApplication.outputDirectory.toPath().relativize(rootDir.toPath()).toFile()
        output.outputFileName = new File( "$relativeRootDir" + File.separator+"libs", project.name+"-"+project.versionName+".apk")
    }
}
}

apply plugin: 'com.google.gms.google-services'
Mahabub Karim
  • 810
  • 11
  • 17
  • Any similarity with this https://stackoverflow.com/questions/52470044/warning-api-variant-getjavacompile-is-obsolete-and-has-been-replaced-with – Shubham AgaRwal Apr 20 '19 at 11:25
  • No, thanks for the response – Mahabub Karim Apr 20 '19 at 11:30
  • 1
    Possible duplicate of [variantOutput.getPackageApplication() is obsolete](https://stackoverflow.com/questions/54206898/variantoutput-getpackageapplication-is-obsolete) – Martin Zeitler Apr 20 '19 at 11:52
  • When I hide this line "apply plugin: 'com.google.firebase.firebase-crash'" get this error "WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. It will be removed at the end of 2019." And If I don't hide this line I get this error "WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'. It will be removed at the end of 2019." And If I run the project I find this error "Manifest merger failed with multiple errors, see logs". Please help me with this – Mahabub Karim Apr 20 '19 at 12:01

1 Answers1

1

You can safely ignore it. Some plugins like Fabric cause those warnings, as it's devs have to adapt to new Android Studio/Gradle releases. Just make sure to use latest versions of your dependencies.

solidogen
  • 591
  • 5
  • 12
  • no Fabrics like library is added, all versions are up to date – Mahabub Karim Apr 20 '19 at 11:40
  • 2
    ```apply plugin: 'com.google.firebase.firebase-crash'``` Probably this one is the culprit, you can try to comment it out. But then your crash analytics will not work, so simply ignore the warning. Your app will still work fine. – solidogen Apr 20 '19 at 11:45
  • Now I get this Error message : "API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. " – Mahabub Karim Apr 20 '19 at 11:49
  • `apply plugin: 'com.google.gms.google-services'` Well, only this one can cause this, but your build will _probably_ break without it – solidogen Apr 20 '19 at 11:53
  • Check what is the error in AndroidManifest.xml. Open AndroidManifest.xml file and select 'Merged Manifests' tab below the file window. – Ranjan Kumar Apr 20 '19 at 15:07