270

I am getting this error while I am building APK.

Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
    at org.gradle.workers.internal.DefaultWorkerExecutor$WorkerExecution.waitForCompletion(DefaultWorkerExecutor.java:285)
    at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:115)
    at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:87)
    at org.gradle.workers.internal.DefaultWorkerExecutor.await(DefaultWorkerExecutor.java:150)
    at com.android.build.gradle.internal.tasks.Workers$WorkerExecutorAdapter.await(Workers.kt:282)
    at com.android.ide.common.resources.MergeWriter.end(MergeWriter.java:48)
    at com.android.ide.common.resources.MergedResourceWriter.end(MergedResourceWriter.java:242)
    at com.android.ide.common.resources.DataMerger.mergeData(DataMerger.java:292)
    at com.android.ide.common.resources.ResourceMerger.mergeData(ResourceMerger.java:384)
    at com.android.build.gradle.tasks.MergeResources.lambda$doFullTaskAction$1(MergeResources.java:261)
    at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:58)

Tried to invalidate cache and restart android studio.Rebuild project but none of them works for me.

Kabir
  • 852
  • 7
  • 11
apurv thakkar
  • 8,608
  • 3
  • 14
  • 19
  • 1
    Yes. It is also showing heap size issue. But I have already allocated maximux heap size. – apurv thakkar Aug 22 '19 at 10:10
  • it is pretty much impossible to debug this with just his much info buddy, i thinki reddit/quora might be more helpful than stack, you wont be allowed to have discussions here – Kushan Aug 22 '19 at 10:11
  • 4
    Thanks Kushan.I found a solution after adding "org.gradle.jvmargs=-Xmx4608m" in gradle.properties – apurv thakkar Aug 22 '19 at 10:16
  • [here](https://stackoverflow.com/questions/61986128/gradle-threw-an-error-while-downloading-artifacts-from-the-network-exception) maybe help you. this is useful for me – ifredom Nov 03 '20 at 09:39
  • Hi, I am having the same issue. How did you add "org.gradle.jvmargs=-Xmx4608m"? Where can I find the gradle.properties? – vlntn Jan 06 '21 at 10:12
  • 1
    This is just the start of the stack trace. You need to scroll down to where it says "Caused by:" and search on what follows. In my case it was a different cause and solution, which I finally found here: https://stackoverflow.com/a/47132142/989468 – Chiwda Mar 01 '21 at 23:55
  • similer as [https://stackoverflow.com/q/75334965/9344934](https://stackoverflow.com/q/75334965/9344934) – PK Chahar Feb 03 '23 at 11:33

53 Answers53

477

This can be solved by increasing the amount of JVM memory available to Gradle.

Add (or edit) the following line in the gradle.properties file:

org.gradle.jvmargs=-Xmx4608m
cubuspl42
  • 7,833
  • 4
  • 41
  • 65
apurv thakkar
  • 8,608
  • 3
  • 14
  • 19
  • Can you give your stacktrace? – apurv thakkar Sep 10 '19 at 09:38
  • 2
    https://stackoverflow.com/questions/57852877/after-update-of-android-studio-3-6-gradle-to-3-5-0-unable-to-run-project Answered here – Amin Pinjari Sep 10 '19 at 09:41
  • 23
    I have no idea what this does but it worked, can you add some info? – Sven van den Boogaart Nov 07 '19 at 12:59
  • 15
    org.gradle.jvmargs represent the arguments that will be passed to the Java virtual machine used during build time. The Xmx option with a number (in this very special syntax) is commonly used to set the maximum size of the heap in megabytes, while Xms is used to set the minimal one. – PoutchiPatch Dec 16 '19 at 15:58
  • 6
    for more guidance to this problem, scroll to the bottom of the stack trace, mine is `Caused by: org.gradle.api.GradleException: Can't process attribute android:fillColor="@android:color/holo_red_dark": references to other resources are not supported by build-time PNG generation. File was preprocessed as vector drawable support was added in Android 5.0 (API level 21)` – sea Dec 20 '19 at 13:39
  • What's the reason? – c-an May 18 '20 at 00:58
  • 2
    i have applied your solution but still getting error. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugJavaResource'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > File 'com.android.builder.files.ZipCentralDirectory@3a9a7373' was deleted, but previous version not found in cache – Kamlesh Oct 29 '20 at 03:16
  • 1
    @Kamlesh, Once you put "org.gradle.jvmargs=-Xmx4608m", delete build file and invalidate cache and restart android studio. – apurv thakkar Oct 29 '20 at 06:21
  • `xmx` = maximum memory allocation in java. You pretty much gives the program 4gb of ram space to work with – Gabriel Petersson Dec 22 '20 at 12:18
  • have -Xmx4g already, but still doesn't work – Tertium Mar 10 '21 at 14:21
  • For me org.gradle.jvmargs=-Xmx4096m – Achintha Isuru Dec 22 '21 at 06:26
63

Try this, in Android Studio

File > Invalidate Caches/Restart... 
Raj Yadav
  • 9,677
  • 6
  • 35
  • 30
  • 9
    I did but I still got a similar error after building the project. – Hesam Mar 10 '20 at 19:19
  • Also, try to clean the project and then File > Invalidate Caches/Restart... and check if that works – Raj Yadav Mar 17 '20 at 09:52
  • 1
    Yaday. Thanks for your reply. The problem was the latest unstable version of the Android Gradle build tool. I downgraded to the latest stable version and the problem's gone. – Hesam Mar 17 '20 at 18:15
  • and you may sync gradle – oguzhan Jul 22 '20 at 19:22
  • For me there was an issue with one of my xmls files missing the tools namespace declaration. Hoping to help somebody who still doesn't solve his/her problem by invalidating and restarting. – devDeejay Jun 29 '22 at 10:23
  • 1
    I don't this is the right solution but it worked on me. – Josphat Mwania Jan 05 '23 at 07:16
31

I already had multidex enabled but the version was too old so upgraded and it fixed the issue:

// Old version
implementation "com.android.support:multidex:1.0.3"
// New version
def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"
jQN
  • 459
  • 6
  • 5
31

In my case, I enabled multidex

Open [project_folder]/app/build.gradle and add following lines.

defaultConfig {
    ...

    multiDexEnabled true
}

and

dependencies {
    ...

    implementation 'com.android.support:multidex:2.0.1'
}
Abir Ahsan
  • 2,649
  • 29
  • 51
15

Encountered Similar issue... the fix for me was changing/updating the gradle version

   classpath "com.android.tools.build:gradle:4.1.2" 

to

   classpath "com.android.tools.build:gradle:4.1.3"

worked for me

Rabi Rafique
  • 171
  • 1
  • 5
  • I had a problem with classpath 'com.android.tools.build:gradle:7.2.0' but going back to classpath 'com.android.tools.build:gradle:7.1.3' resolved that – natansalda May 20 '22 at 07:19
13

gradle.proprites

org.gradle.jvmargs=-Xmx1536M

build.gradle

defaultConfig {
        multiDexEnabled true
    }

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}

and yet theses stuff did not fix my problem, until I increase the compileSdkVersion from 27 to 28, it worked for me.

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
         minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    buildTypes {
        release {
            crunchPngs false
        }
    }
}
Hans Knöchel
  • 11,422
  • 8
  • 28
  • 49
Zeyad Alhababi
  • 220
  • 2
  • 6
12

I removed this issue by adding the following lines

add multiDexEnabled true in android>app>build.gradle inside defaultConfig

add implementation 'com.android.support:multidex:1.0.3' in android>app>build.gradle inside dependencies

Utkarsh Singh
  • 347
  • 3
  • 10
8

I got an stacktrace similar to yours only when building to Lollipop or Marshmallow, and the solution was to disable Advanved profiling.

Find it here:

Run -> Edit Configurations -> Profiling -> Enable advanced profiling

https://stackoverflow.com/a/58029739/860488

Morten Holmgaard
  • 7,484
  • 8
  • 63
  • 85
  • 1
    I accidentally enable advanced profiling and disabling it fixed the problem. Your answer helps me to get into that issue – Zulqarnain Feb 06 '20 at 10:54
7

search your code you must be referring to color in color.xml in an xml drawable. go and give hex code instead of referencing....

Example: in drawable.xml you must have called

android:fillColor="@color/blue"

change it to android:fillColor="#ffaacc" hope it solve your problem...

Engr Waseem Arain
  • 1,163
  • 1
  • 17
  • 36
7

please check if current icons are not on debug folder if so move them to main folder or recreate them enter image description here

ruby
  • 3
  • 1
devio
  • 607
  • 9
  • 29
6

classpath 'com.android.tools.build:gradle:3.3.2' Change the class path and it will work.

David Lee
  • 665
  • 7
  • 20
Savan Patel
  • 169
  • 8
6

I also have the same issue , and you can add this

org.gradle.jvmargs=-Xmx4608m on your Gradle.properties

but in my case I change like this :

from : org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

to: org.gradle.jvmargs=-Xmx4608m -Dfile.encoding=UTF-8

Jonathan
  • 1,955
  • 5
  • 30
  • 50
5

In right side of android studio click gradle -> app -> build -> assemble. then android studio will start building, and print you a proper message of the issue.

Gg M
  • 386
  • 3
  • 6
5

Solution for:

Caused by 4: com.android.builder.internal.aapt.AaptException: Dependent features configured but no package ID was set.

All feature modules have to apply the library plugin and NOT the application plugin.

build.gradle (:androidApp:feature_A)

apply plugin: 'com.android.library'

It all depends on the stacktrace of each one. Cause 1 WorkExecutionException may be the consequence of other causes. So I suggest reading the full stacktrace from the last cause printed towards the first cause. So if we solve the last cause, it is very likely that we will have fixed the chain of causes from the last to the first.

I attach an example of my stacktrace where the original or concrete problem was in the last cause:

Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction

Caused by: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-4.2.0-alpha16-6840111-linux Daemon #0: Unexpected error during link, attempting to stop daemon.

Caused by: java.io.IOException: Unable to make AAPT link command.

Caused by 4: com.android.builder.internal.aapt.AaptException: Dependent features configured but no package ID was set.

GL

Feature Package ID was not set

Braian Coronel
  • 22,105
  • 4
  • 57
  • 62
5

in my code i am using latest version of flutter and packages and remove this error by adding the line in

multiDexEnabled true 

in app level build.gradle

Akbar Masterpadi
  • 976
  • 8
  • 15
4

Working on android studio: 3.6.3 and gradle version:

classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"

Adding this line in

gradle.properties file

org.gradle.jvmargs=-Xmx512m
Ali Azaz Alam
  • 1,782
  • 1
  • 16
  • 27
4

just add

android.enableJetifier=true

to the gradle.properties .

actually this happens mostly when you mess up with androidx and support libraries, some dependencies are currently not fully supporting androidX. so you have to enable jetfier.

3

I update this and worked for me in gradle wrapper properties

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Omar Essam El-Din
  • 1,415
  • 14
  • 17
3

This fixed my issue.

cd android && ./gradlew clean
Anish B.
  • 9,111
  • 3
  • 21
  • 41
Vivek
  • 176
  • 1
  • 8
2

If you've tried all the solutions above and still doesn't resolve your issue.

This might not seemed related, but here's my take on it.

Try removing this from your Gradle dependency, I've spend 2 hours of my time because of this roadblock.

implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0"

Morgan Koh
  • 2,297
  • 24
  • 24
2

found the solution.

add this code to your build.gradle,

dependencies {
    def multidex_version = "2.0.1"
    implementation 'androidx.multidex:multidex:$multidex_version'
}

then enable the multidex to true

 defaultConfig {
        ...
        minSdkVersion 15 
        targetSdkVersion 28
        multiDexEnabled true
    }


2

I got this problem when I directly downloaded code files from GitHub but it was showing this error, but my colleague told me to use "Git bash here" and use the command to Gitclone it. After doing so it works fine.

2

In my case the issue was related to View Binding. It couldn't generate binding classes due to an invalid xml layout file. In the file I had a Switch with an id switch, which is a Java keyword. Renaming the Switch id resolved the issue.enter image description here

Yamashiro Rion
  • 1,778
  • 1
  • 20
  • 31
2

How To Solve A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Error? To Solve A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Error Just open your app/build.gradle file and change this line. androidx.core:core-ktx:+ replace with androidx.core:core-ktx:1.6.0 Here is an Example. If you are using androidx.core:core-ktx:+ then this will find the latest version of androidx.core:core-ktx:+ and the latest one is 1.7.0 and the latest version needs the Android 31 compile SDK. So that You are facing this issue. Here is Two Possible Solution use a specific version, use androidx.core:core-ktx:${version} instead of androidx.core:core-ktx:+ upgrade the compile SDK to Android 31 full article is Here

Mohd Qasim
  • 896
  • 9
  • 20
2

I solved this problem by adding this line to gradle.properties.

android.enableJetifier=true

2

try to add this to your gradle.properties

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
Aqib shahzad
  • 491
  • 1
  • 4
  • 11
1

If any one having this issue in flutter after adding firebase storage. Do flutter clean and re run it, it will work

Zeeshan Mehdi
  • 1,241
  • 1
  • 17
  • 18
1

if you are stuck in this error below

Execution failed for task ':app:signReleaseBundle'. > A failure occurred while 
executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > 'other' 
has different root

**then do it change the location your the .abb in time of generating to your project(own project of this .aab) then go to app and then select the realese folder to save your .aab **

Mazhar Iqbal
  • 813
  • 7
  • 7
1

I was implementing dark mode in the activity. I just declared attributes tag without using it anywhere so got this same error. Make sure you declare, define and use all the resource values in the code (specially attribute tags).

If you have such resource errors then you will not get a proper problem correction through android studio. You have to keep undo your changes carefully.

Suyog
  • 415
  • 1
  • 6
  • 15
1

Check for any special characters in names for all the files of your project (like brackets [] in my case when exporting from unity).

Anibal
  • 21
  • 1
1

Make sure that:

Compile sdk version = build tools version = target sdk version

ea_
  • 111
  • 1
  • 3
1

This is the snapshot of the issue that I was having.

Execution failed for task ':app:mergeDebugJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction 2 files found with path 'META-INF/gradle/incremental.annotation.processors' from inputs

This indicated that there were files causing a conflict during the merging process.

To resolve this issue I added this line of code on the packagingOptions.

android {
    ....

      packagingOptions {
        resources {
           excludes += '/META-INF/{AL2.0,LGPL2.1}'
            exclude 'META-INF/gradle/incremental.annotation.processors'
        }
    }
}
Tonnie
  • 4,865
  • 3
  • 34
  • 50
0

You may get an error like this when trying to build an app that uses a VectorDrawable for an Adaptive Icon. And your XML file contains "android:fillColor" with a <gradient> block:

res/drawable/icon_with_gradient.xml

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:aapt="http://schemas.android.com/aapt"
    android:width="96dp"
    android:height="96dp"
    android:viewportHeight="100"
    android:viewportWidth="100">

    <path
        android:pathData="M1,1 H99 V99 H1Z"
        android:strokeColor="?android:attr/colorAccent"
        android:strokeWidth="2">
        <aapt:attr name="android:fillColor">
            <gradient
                android:endColor="#156a12"
                android:endX="50"
                android:endY="99"
                android:startColor="#1e9618"
                android:startX="50"
                android:startY="1"
                android:type="linear" />
        </aapt:attr>
    </path>
</vector>

Gradient fill colors are commonly used in Adaptive Icons, such as in the tutorials here, here and here.

Even though the layout preview works fine, when you build the app, you will see an error like this:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Error while processing Project/app/src/main/res/drawable/icon_with_gradient.xml : null

(More info shown when the gradle build is run with --stack-trace flag):

Caused by: java.lang.NullPointerException
    at com.android.ide.common.vectordrawable.VdPath.addGradientIfExists(VdPath.java:614)
    at com.android.ide.common.vectordrawable.VdTree.parseTree(VdTree.java:149)
    at com.android.ide.common.vectordrawable.VdTree.parse(VdTree.java:129)
    at com.android.ide.common.vectordrawable.VdParser.parse(VdParser.java:39)
    at com.android.ide.common.vectordrawable.VdPreview.getPreviewFromVectorXml(VdPreview.java:197)
    at com.android.builder.png.VectorDrawableRenderer.generateFile(VectorDrawableRenderer.java:224)
    at com.android.build.gradle.tasks.MergeResources$MergeResourcesVectorDrawableRenderer.generateFile(MergeResources.java:413)
    at com.android.ide.common.resources.MergedResourceWriter$FileGenerationWorkAction.run(MergedResourceWriter.java:409)

The solution is to move the file icon_with_gradient.xml to drawable-v24/icon_with_gradient.xml or drawable-v26/icon_with_gradient.xml. It's because gradient fills are only supported in API 24 (Android 7) and above. More info here: VectorDrawable: Invalid drawable tag gradient

Mr-IDE
  • 7,051
  • 1
  • 53
  • 59
0

I know this might not be a complete or exact solution, but for those who are still facing issues even after doing what is given on this thread, check for your files in value folder. For me there was a typo and some missing values. Once i fixed them this error stopped.

DeadPool
  • 71
  • 3
0

If you getting this error saying signing-config.json (Access denied) means just exit the android studio and just go to the desktop home and click on the android studio icon and give Run as Administrator, this will sort out the problem (or) you can delete the signing-config.json and re-run the program :)

T Manojith
  • 123
  • 1
  • 6
0

I was also facing the same problem a few minutes before when I tried to run a flutter project in my C/(.something../.something../.something../.something....) directory,

So I created a new folder in my E directory and started a new project there and when I run it ..... surprisingly it worked. I don't know why?

This was the message that I got after running in E: directory

Launching lib\main.dart on Lenovo K33a42 in debug mode...
Running Gradle task 'assembleDebug'...
Checking the license for package Android SDK Platform 28 in 
C:\Users\Shankar\AppData\Local\Android\sdk\licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in 
C:\Users\Shankar\AppData\Local\Android\sdk\platforms\android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
Parameter format not correct -
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
Debug service listening on ws://127.0.0.1:51105/5xCsT5vV62M=/ws
Syncing files to device Lenovo K33a42...
PiRocks
  • 1,708
  • 2
  • 18
  • 29
0

In my case problem arose due to gradle version upgradation from 6.2 all to 6.6 all in gradle wrapper. So i wiped out data of avd and restarted it and then deleted .gradle folder in android/.gradle and then run yarn start --reset-cache and yarn android. Then it worked for me

0

Clean Project -> Invalidate caches/restart. My problem resolved with this.

0

In my case, I was using react native and it happened when the gradle was updated to new version. I knew it had something to do with gradlew. I checked the repo which I puhsed few days ago on github. I changed the gradle class path inside android/build.gradle dependencies and added

classpath("com.android.tools.build:gradle:3.5.3")
classpath 'com.google.gms:google-services:4.3.3'

it solved my issue.

Sanan Ali
  • 2,349
  • 1
  • 24
  • 34
0

in my case for Kotlin build.gradle:app add a line dependencies: multiDexEnabled true and add def multidex_version = "2.0.1" implementation 'androidx.multidex:multidex:$multidex_version'

Demonick
  • 2,116
  • 3
  • 30
  • 40
0

In my case I just had 2 modules named the same way, but in different paths:

from ./settings.gradle

include ':presentation'
include ':third_parties/presentation'

I just renamed one of the two modules and updated ./settings.gradle and I solved the issue:

include ':presentation'
include ':third_parties/ui-implementation'

Hope this might help somebody

0

in my case it was due to

//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:23.1.1'

//noinspection GradleCompatible
compile 'com.android.support:design:23.1.1'

try removing it.

0

do invalidate caches and restart, later Restarting the laptop did the job for me.

Sriraksha
  • 459
  • 1
  • 8
  • 15
0

Try checking your anti-virus if it blocked any important Java 8 file/s

My project was working completely fine when suddenly I was getting this error. I spent a good two hours trying to fix this issue. After restarting my computer and rebuilding the project, the issue was still there, but then my anti-virus (Avast) showed a pop-up saying it "protected" me from a dangerous file. I just allowed the file then suddenly everything is working fine like it used to.

Gemeaux
  • 76
  • 3
0

delete white space in folder name on the path it solved the problem

0

I had this issue and that was caused by @org.jetbrains.annotations.NotNull() in one of my implementations. I read gradle error carefully and found that.

Hamid Javed
  • 51
  • 1
  • 5
0

Please try to update your constraint layout

implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

Mohamed Hussien
  • 1,084
  • 13
  • 14
0

I got this error because I was missing a

/>

at the end of one of my lines in activity_main.xml

JohnHarbaugh
  • 155
  • 1
  • 3
  • 11
0

In my case this issue was caused by the fact i replaced all the content of folder android/app/src/main/res because i was changing my app icon.

My solution is to keep the folders:
android/app/src/main/res/value
android/app/src/main/res/values-night

Zorro
  • 1,085
  • 12
  • 19
0

Here what i found just add this line gradle.properties

org.gradle.jvmargs=-Xmx4g

0

In local property at the root of android folder set min sdk version to 21:

flutter.minSdkVersion=21

and in app->build.gradle

defaultConfig {
        [...]
        minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()

As per documentation:

Note: Multidex support is natively included when targeting Android SDK 21 or later.

They also cautiously warn:

However, it isn’t recommended to target API 21+ purely to resolve the multidex issue as this might inadvertently exclude users running older devices.

But SDK 21 was released almost 10 years ago with Android version 5,0 Lollipop as you can see: https://en.wikipedia.org/wiki/Android_Lollipop (not to mention that these devices, if they still exist, often have the capabilities to upgrade their Android version).

Antonin GAVREL
  • 9,682
  • 8
  • 54
  • 81
0

This error happened to me, when I deleted a module from my project, but forgot to remove it from settings.gradle file. So maybe this might be your case too.

-2

Worked for me when changed:

        <activity
        android:name="com.packagename.PurchaseActivity"
        android:configChanges="orientation|screenSize"
        android:label="@string/title_activity_purchase"
        android:screenOrientation="portrait" />

to

        <activity
        android:name=".PurchaseActivity"
        android:configChanges="orientation|screenSize"
        android:label="@string/title_activity_purchase"
        android:screenOrientation="portrait" />

Removed the package name to all java classes as part of the application and it solved the issue for me :-)

The application was migrated to AndroidX recently.

itzo
  • 1,220
  • 14
  • 18