How to solve "app:transformClassesWithDesugarForDebug" in Android? - android

Here I am getting the following issue while I try to run the app after updating build version.Even I tried many relevant solution which was answered in StackOverflow. But noting works.
Even I did the following :
clean the project,
Invalidate Cache & Restart,
Delete app/build/intermediates everything.
android.enableD8.desugaring = true (or) android.enableD8=true
Nothing works.The issue is as follows,
Error:Execution failed for task ':app:transformClassesWithDesugarForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException:
com.android.ide.common.process.ProcessException: Error while executing java process with
main class com.google.devtools.build.android.desugar.Desugar with arguments
{#PROJECT_NAME\app\build\intermediates\tmp\desugar_args5924990363826958654}
Your answer is more valuable. Please support me

Related

Error showing while I did nothing : Execution failed for task ':app:mergeDebugResources'. ; Caused by: java.lang.NullPointerException

I'm currently creating an application with Android Studio and Kotlin.
This morning, when I tried to run the app on the emulator and my phone, I got an error but what I don't understand it's I barely change the code : I just added a textview (tried to delete it but I still got the error. I tried to investigate and do think but none of them worked. I still don't really understand the error, could you help me fix it ?
Here the error :
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
Caused by: com.android.aaptcompiler.ResourceCompilationException: Resource compilation failed. Check logs for details.
at com.android.aaptcompiler.ResourceCompiler.compileResource(ResourceCompiler.kt:126)
at com.android.build.gradle.internal.res.ResourceCompilerRunnable$Companion.compileSingleResource(ResourceCompilerRunnable.kt:34)
at com.android.build.gradle.internal.res.ResourceCompilerRunnable.run(ResourceCompilerRunnable.kt:15)
at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
... 3 more
Caused by: java.lang.NullPointerException
at com.android.aaptcompiler.TableExtractor.flattenXmlSubTree(TableExtractor.kt:851)
at com.android.aaptcompiler.TableExtractor.parseXml(TableExtractor.kt:516)
at com.android.aaptcompiler.TableExtractor.parseArrayImpl(TableExtractor.kt:1300)
at com.android.aaptcompiler.TableExtractor.parseStringArray(TableExtractor.kt:1243)
at com.android.aaptcompiler.TableExtractor.access$parseStringArray(TableExtractor.kt:146)
at com.android.aaptcompiler.TableExtractor$extractResource$parseBagMethod$13.invoke(TableExtractor.kt:437)
at com.android.aaptcompiler.TableExtractor$extractResource$parseBagMethod$13.invoke(TableExtractor.kt:437)
at com.android.aaptcompiler.TableExtractor.extractResource(TableExtractor.kt:458)
at com.android.aaptcompiler.TableExtractor.extractResourceValues(TableExtractor.kt:267)
at com.android.aaptcompiler.TableExtractor.extract(TableExtractor.kt:182)
at com.android.aaptcompiler.ResourceCompiler.compileTable(ResourceCompiler.kt:186)
at com.android.aaptcompiler.ResourceCompiler.access$compileTable(ResourceCompiler.kt:1)
at com.android.aaptcompiler.ResourceCompiler$getCompileMethod$1.invoke(ResourceCompiler.kt:137)
at com.android.aaptcompiler.ResourceCompiler$getCompileMethod$1.invoke(ResourceCompiler.kt:137)
at com.android.aaptcompiler.ResourceCompiler.compileResource(ResourceCompiler.kt:123)
... 29 more
Thanks a lot
EDIT :
So, I've searched a lot, tried many things but none of them worked. Because my project is still small, I created a new project and copy/paste all my code and I this new project everything work and I don't have any error anymore.
Good luck if you encounter the same error.
Just had this error myself and after awhile managed to find the issue, I had strings within array-lists located in my strings.xml, some of my strings included apostrophes, for instance in don't won't can't.
Removing these allowed me to build my project again.
The solution that worked for me is locate the String.xml file. Delete the unused Strings I meant the strings that didnt had any reference in arrayList file.
Make sure gradle offline mode is not enabled.
Then do file->invalidate
then click invalidate and restart.
This should solve the issue

Android ndk_project_path = NULL Error

I know this question has been asked before many times but none of the solution is working for me.
Whenever I am trying to run my project I am getting this error:
Error:Execution failed for task ':gpuimage:compileReleaseNdk'.
com.android.ide.common.process.ProcessException: Error while executing process F:\Android\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=F:\Studio_Workspace\klubchat-android\gpuimage\build\intermediates\ndk\release\Android.mk APP_PLATFORM=android-25 NDK_OUT=F:\Studio_Workspace\klubchat-android\gpuimage\build\intermediates\ndk\release\obj NDK_LIBS_OUT=F:\Studio_Workspace\klubchat-android\gpuimage\build\intermediates\ndk\release\lib APP_STL=gnustl_shared APP_ABI=all}
Please let me know how can I resolve this issue. I am stuck because of this.
Thanks in Advance!

64K method count exceed error , for close to 62.5K method reference count

The method count for my app apk in the apk analyzer is shown as 62481. It's close but still not over 64K. There's no other .dex file, only the highlighted one. I still get the "The number of method references in a .dex file cannot exceed 64K." error while running the app. If I make it a multidex application it executes without any issues.
Is there something I am missing?
Thanks in advance.
PS. I also used an online tool at http://inloop.github.io/apk-method-count.
It also shows the same count.
Stacktrace:
Error:The number of method references in a .dex file cannot exceed 64K.Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
Error:Execution failed for task ':app:transformClassesWithDexForDevDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --output D:\Xyz\abc\app\build\intermediates\transforms\dex\dev\debug\folders\1000\1f\main D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_1db0d0b69914354c7a1f54768d6d2b5c56a14a07.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_836009343e593bdd8d97066c1d4d35a4bac1ee03.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\logging-interceptor-3.2.0_e343134b40348a9375191b04bcb9815ad536eeb2.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\support-annotations-25.3.1_0ba0705a7d535784c50abb2c1df9c6ecd3b76c98.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_2e91d022d43bd04e01ff1ad098ec0770289b4c62.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_2e8f50ec08e5c86040aa91ab1741d7343a67f4f8.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_56c577ef5726762c4031ca5dda95111b9dc7e458.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_8a11d8b5e54b85a6e1de144a7cb6b1a4e6fd4ab4.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_60ec19e545d0173331896d4142d37b46059c43a3.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_7f0598945bce91b289e292f0f55a3b3d72fbf351.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\jackson-core-asl-1.9.7_f4c11563ba078112f420d3670220ff4b972681f9.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_30f2ee70b7f228236ae4edfc7d2c64f9216386c9.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_59a52153273d00e2e703ed0658850f6a5d884966.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\okhttp-3.8.0_9dc1c3bb542549a12a11d8322d4a6481d2d02cf0.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_b2bda403ff0525ec0227a0f80e19afca69d12b67.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\butterknife-annotations-8.2.1_3a165264321d2f81fe77b7c2637671018e4cac57.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_cc143144ac466f41255b7f36bfbd3d0ea695a209.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_824200b22e8ea74a383eac9a277e3ac2464aa539.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_a4e001df1fa4644f23dcefc07868e903a5607863.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_e2ecd357ba3fb919c3a438530d0290e93647178a.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\retrofit-2.3.0_68728c00c537fecad305d89fa97c2421840a623a.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\eventbus-3.0.0_e0bff5f7960a2e7ecac4f69bde0f78a82ca5e63d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\jackson-mapper-asl-1.9.7_5369f60c40e50a63d03a92ef2ae29385677ceb8f.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_c6b3c7487cd2e972f77ca0e03bb19710c73e53e0.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_91361bf27fc5b6e472e367aa00f031bba7c4c20a.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\pgsdk_645c5225a64fe7c0b1a59aec735ebc050640f22d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_f85f3afb04ff29a87a12af3638aef9aae6220a24.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_a1fc8b96a2a8c9acf7c645a9259c58c41a1f26fd.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_a7d0bdd1c2bdc70470127f504b003285bc078fe9.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\rxjava-1.1.1_8e601112604030616d0454987beb13c6bd5559f7.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_cf60fb6a5a8e2e831c1ac5e904054d7cae4fb66b.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\bolts-android-1.2.1_747b105f3d05185ddbb7f3461fcfcfb14fd400ad.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_3df31fa2a2dfd25d1ef407482294b0a9e4681dd4.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_880f0190688e96d2158375d20eb2b6a3ad0a1c00.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_a9174f45b029718961bea6288c5ab72b69c8d83c.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\adapter-rxjava-2.0.1_e254eec75d7b47f606b6044afe4f5de923c90209.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\library-2.4.0_aa6ede67eeee82afb5059b7cc11f144669e8d317.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\glide-3.6.1_eaf678ca6bb624fad8c858722d2c87b6d59be41a.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_7daee3352899d51e4a9fe3f8b397499be0258db8.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_8f9dc6ff8f790bc8764ce044b5b1932958f23f34.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_30f0950a769a9270e254c7ca0c6a59f5f6401d22.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_4a2b2594a565922e474f16ffba114c7002d1a6cb.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_30fe7465623d9f918d58d6edc58452e68aefdace.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_df3ee71424be542d1c2312a5b88578621627461a.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\converter-gson-2.2.0_243824882f104fb7a674d1f7f050d17f53106431.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_411c4b35195250868998df3b091d787100369a10.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_d2afcb23c7f7377b02c40aa75147aaa062228f64.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\httpclient-android-4.3.5_f8796db42b8aa66927828d31c761f0fddedbb772.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\okhttp-urlconnection-3.2.0_d542fad0507536391190065b8f9437055ccb7ec4.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_aba481f309d2fb09d40e15dd99edc01c161c6ad6.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\android-auto-scroll-view-pager-1.1.2_c97341019a7b0d29b9d66da4f9922ddf63d2d79d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_bed303341316ad80fca44d4ef59f78e331db2eea.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\okio-1.13.0_c8981a062393bcce02a0a96d7eada6216359b2c1.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_ecae2ffa55c32320769f0dbad6bfc31f8fe4b89b.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_1a190aa1f8a574c091a5817b5f14c3eb6fc7d54d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_47e5bef139248db621fc15da425e6ef000f8d1bd.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_0f5cd2cb52b7d4f288ad9e8011572878dd28daf1.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\httpmime-4.3.6_c281370eb9c8ee9d741d91e11bb30c8e896b2a58.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\okhttp-2.3.0_4e123907da30c2cd9d1f9862f2daa77436911e75.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_79b6efa0386df702de375178db0cc4c91ee16251.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_7b485f1753fd8a21285f68f4a5e82b3c9e3b7ce5.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_fffbb83068c9bb8ccc07ebafbdf10bfbb39a5ed3.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_0c6da562aac3d9ee3da240276b4588219e13286d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_4cb6cc03b1dfb6968d9ba10603ae4401cffc9ee4.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_7109e5c327c1f89c08882b5cd1861f4316a13978.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\gson-2.7_7ed1d08353e6bed2c04dde33c5774a7d806dc0e8.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\javax.annotation-api-1.2_8c1b8b35c9219706f347411da651634f419b0bc5.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_8b802d0ed2c87696bde342b3a35978ec09593815.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_ff73a2835210f90ea5eb74d9ee7d3d53acc7d0bd.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_8136d3746547bd087e4415cc0d16dea272792c80.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_9efdaefe6637a742ef19f1d0780d46930c401498.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_3993fa06956ed2627c1c4a6d5fb8e2698532576f.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_973b2919579e6677a87ed69b39531a634cc9caf5.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\okhttp-urlconnection-2.3.0_c4971a2461656fb7836c771c25274b1b14cbdd47.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\debug_41a4fb652b966a530aadf11ba3e268e403f48a5d.jar D:\Xyz\abc\app\build\intermediates\pre-dexed\dev\debug\classes_af64895670d5e2390fb265b2c8fec8bbd127ec31.jar}
Ok. This was one of those oops issues.
The apk I was analyzing was a release build with minifyEnabled true. But while executing the app debug build was selected for which proguard was not enabled and hence the error.

Android studio has stopped my project with an error execution failed for task ':app:buildInfoDebugLoader'

I run my android project, everything is correct and an error comes to say execution failed for task as shown on details.
Details :
Error:Execution failed for task ':app:buildInfoDebugLoader'. > Exception while doing past iteration backup : Source C:\Users\Abdulwahid\AndroidStudioProjects\More1Activity\app\build\intermediates\builds\debug\13727462725703\classes.dex and destination C:\Users\Abdulwahid\AndroidStudioProjects\More1Activity\app\build\intermediates\builds\debug\13727462725703\classes.dex must be different
It just need to rebuild the project.

Robotium + Android studio

When I run robotium (5.2.1) tests from android studio 1.0 RC 2, I get this following error ==>
:app:shrinkDebugTestMultiDexComponents FAILED
Error:Execution failed for task ':app:shrinkDebugTestMultiDexComponents'.> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options?
I have no problem to run the application "in normal mode".
Do you know where is my problem ?
Thx in advance
EDIT
According to Jared Burrows's answer I can pass task shrinkDebugTestMultiDexComponents but now I have this problem
:app:packageAllDebugTestClassesForMultiDex FAILED
Error:Execution failed for task ':app:packageAllDebugTestClassesForMultiDex'.> java.util.zip.ZipException: duplicate entry: android/support/multidex/BuildConfig.class

Categories

Resources