I've updated to MacOS Catalina. This morning while I was working on my Android project, it suddenly started giving the following exception: "ERROR: Cause: error=86, Bad CPU type in executable".
I suspect it it because I updated to macOS 10.15 AND because I tried to build the APK for my project (so it rebuilt the renderscript stuff). Here is the full stack trace given:
org.gradle.process.internal.ExecException: A problem occurred starting process 'command '/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:232)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:209)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:356)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:38)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:748)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start '/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:97)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
... 7 more
Caused by: java.io.IOException: Cannot run program "/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld" (in directory "/Users/name/Documents/Projects/onlinetrucks_android/MyApplication/app"): error=86, Bad CPU type in executable
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 10 more
Caused by: java.io.IOException: error=86, Bad CPU type in executable
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 more
and on doing a Gradle Sync, I get
warning: Linking two modules of different target triples: /Users/name/Library/Android/sdk/build-tools/28.0.3/renderscript/lib/bc/x86/libclcore.bc' is 'armv7--linux-android' whereas '/Users/name/Documents/Projects/onlinetrucks_android/MyApplication/app/build/generated/res/rs/debug/raw/bc32/singlesource.bc' is 'armv7-none-linux-gnueabi'
and
Execution failed for task ':app:compileDebugRenderscript'.
A problem occurred starting process 'command '/Users/name/Library/Android/sdk/build-tools/28.0.3/arm-linux-androideabi-ld''
Is there a way to force Android studio to try and use the 64-bit compliant versions of the libraries instead? Any help would be appreciated, as a huge part of the project depends on Renderscript.
Additional notes:
I do not use androidX in this project, as it messes up renderscript and then causes it to NOT be compatible for Google Play's 64-bit requirement.
The renderscript part in my gradle file looks like:
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
To anyone having the same issue, this is a bug. When using renderscript, the linker uses the 32 bit file. Multiple bugs have been logged. If you want to keep track, you can follow what is happening over here:
https://issuetracker.google.com/issues/142590626
Holding thumbs that they fix it soon!
UPDATE: They have fixed it in the latest buildtools version 29.0.3. You also need to update to Android Studio 3.6 to use it.
BONUS: For anyone else trying to update to AndroidX AS WELL - Renderscript might break on Android6. There is a workaround (as far as I can tell) where you set renderscriptSupportModeEnabled to false - but it doesnt fix it for ALL devices (eg. Xiomi Redmi go - Android 8.1 - then breaks for me).
I am using Android studio 4.0, and this issue got fixed for me by just updating the gradle version.
In build.gradle of app:
- ext.gradle_version = '3.5.3'
+ ext.gradle_version = '4.0.0'
And in gradle/wrapper/gradle-wrapper.properties:
- distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Related
When I try to run my unit tests, ReLinker is complaining.
I've added Bugsnag, and it works as it should. Later I add ReLinker like here: https://docs.bugsnag.com/platforms/android/faq/
After adding those two lines I am no longer able to run my tests.
My application onCreate contains:
ReLinker.loadLibrary(this, "bugsnag-ndk")
ReLinker.loadLibrary(this, "bugsnag-plugin-android-anr")
Bugsnag.start(this, config)
Whenever I try to run my tests using RobolectricTestRunner, I get the following errors:
[Robolectric] WARN: Android SDK 29 requires Java 9 (have Java 8). Tests won't be run on SDK 29 unless explicitly requested.
[Robolectric] WARN: Android SDK 30 requires Java 9 (have Java 8). Tests won't be run on SDK 30 unless explicitly requested.
Could not find 'bugsnag-ndk.dll'. Looked for: [armeabi-v7a], but only found: [java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 10
lib\([^\\]*)\bugsnag-ndk.dll
^].
com.getkeepsafe.relinker.MissingLibraryException: Could not find 'bugsnag-ndk.dll'. Looked for: [armeabi-v7a], but only found: [java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 10
lib\([^\\]*)\bugsnag-ndk.dll
^].
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:173)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:180)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at com.roardam.vvitas.Vvitas.onCreate(Vvitas.kt:19)
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:288)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:86)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:288)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:171)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:319)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:269)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I've added ReLinker and Bugsnag with:
implementation 'com.github.KeepSafe:ReLinker:1.4.3'
implementation 'com.bugsnag:bugsnag-android:5.+'
I am not entirely sure the problem is ReLinker, but I am able to run the tests when I remove the two lines loading libraries.
Please let me know if I haven't shown enough code, and I'll update my post with whatever code needed.
Thank you.
This looks to be a Relinker problem as it occurs when loading various other native libraries not just Bugsnag.
I upgraded android studio and I get this weird behaviour
when I run my unit tests they run and complete correctly (I introduced some errors to make sure it was so)
but when I put a breakpoint and use debug tests in java the jvm crashes with this error:
"C:\Program Files\Android\Android Studio4\jre\bin\java.exe" - agentlib:jdwp=transport=dt_socket,address=127.0.0.1:64493,suspend=y,server=n -ea -javaagent:C:\Users\imavrelos\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlinx\kotlinx-coroutines-core-jvm\1.3.9\4be434f5e86c1998a273e7f19a7286440894f0b0\kotlinx-coroutines-core-jvm-1.3.9.jar -Didea.test.cyclic.buffer.size=1048576 -javaagent:C:\Users\imavrelos\AppData\Local\Google\AndroidStudio4.1\groovyHotSwap\gragent.jar -javaagent:C:\Users\imavrelos\AppData\Local\Google\AndroidStudio4.1\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Android\Android Studio4\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\imavrelos\AppData\Local\Temp\idea_classpath1657759720 com.intellij.rt.junit.JUnitStarter -ideVersion5 #w#C:\Users\imavrelos\AppData\Local\Temp\idea_working_dirs_junit.tmp #C:\Users\imavrelos\AppData\Local\Temp\idea_junit.tmp -socket64492
Connected to the target VM, address: '127.0.0.1:64493', transport: 'socket'
java.lang.NoClassDefFoundError: kotlin/collections/AbstractMutableMap
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at kotlinx.coroutines.debug.internal.DebugProbesImpl.<clinit>(DebugProbesImpl.kt:30)
at kotlinx.coroutines.debug.AgentPremain.<clinit>(AgentPremain.kt:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.ClassNotFoundException: kotlin.collections.AbstractMutableMap
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
... 20 more
FATAL ERROR in native method: processing of -javaagent failed
Disconnected from the target VM, address: '127.0.0.1:64493', transport: 'socket'
Process finished with exit code 1
Exception in thread "main"
has anyone got this error? any suggestions on how to fix it?
I fixed it by editing the current Run/Debug Configuration and choosing JAR Manifest in the Shorten command line option.
A similar error can also be caused by using kotlinx-coroutines-core, but it seems to depend on the IDEA version or library.
In my case, debug stopped working after updating IDEA Ultimate to version 2021.2
I fixed this error by editing the current Run/Debug Configuration and disabling the "Shorten command line" option. Before it was set to "classpath file" which seems to bring up the above error in some cases.
I wrote a unit test for a library. When running with usual Ctrl + Shift + F10 it executed, but when tried to debug the test, it didn't run with the error: 'Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/collections/AbstractMutableMap'.
Then I moved the unit test to instrumentation test.
If you are facing this issue in a web-based Gradle project and you are not utilizing kotlin in your project, In that case following steps could help you out:
Check checkbox for 'disable coroutine agent'
File > Settings > Build, Execution, Deployment > Debugger > Data Views
Kotlin > Disable coroutine agent
I updated from Android Studio 3.1.4 to 3.2. Now sync fails with the error message
Sync finish event has not been received
How can this be fixed? Invalidate Caches/Restart did not help.
The ida log shows the following warning:
java.lang.NoClassDefFoundError: org/gradle/wrapper/WrapperConfiguration
at org.jetbrains.plugins.gradle.util.GradleUtil.getWrapperConfiguration(GradleUtil.java:92)
at org.jetbrains.plugins.gradle.service.GradleInstallationManager.getGradleHome(GradleInstallationManager.java:208)
at org.jetbrains.plugins.gradle.service.GradleInstallationManager.doGetGradleHome(GradleInstallationManager.java:194)
at org.jetbrains.plugins.gradle.service.GradleInstallationManager.getGradleHome(GradleInstallationManager.java:129)
at org.jetbrains.plugins.gradle.GradleManager.lambda$getExecutionSettingsProvider$2(GradleManager.java:150)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.getExecutionSettings(ExternalSystemApiUtil.java:732)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doCreateFacade(ExternalSystemFacadeManager.java:201)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doGetFacade(ExternalSystemFacadeManager.java:177)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doInvoke(ExternalSystemFacadeManager.java:132)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager$MyHandler.invoke(ExternalSystemFacadeManager.java:269)
at com.sun.proxy.$Proxy148.getResolver(Unknown Source)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:84)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:163)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:149)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:550)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:647)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.WrapperConfiguration PluginClassLoader[org.jetbrains.plugins.gradle, 181.5540.7.32.5014246] com.intellij.ide.plugins.cl.PluginClassLoader#5f6fe2bb
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:63)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
The only solution I found was to remove Android Studio and reinstall Android Studio 3.2 from scratch.
EDIT
The problem might be different from OP but this is also a new issue in AS 3.2 which gives you Gradle sync error
I had Gradle sync error for the last couple of days after I updated to AS 3.2 and in my case, the problem was one of my library modules contain the following in Manifest.xml
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="27" />
and the solution was to remove 'uses-sdk' (in AndroidManifest.xml file) in ALL the modules in your project.
Try to look into the log of the IDE, for my case it was a flutter plugin causing the issue..
You can navigate to the logs by clicking on show log in the gradle try again strip at the top.
or
go to
~/username/Library/Logs/AndroidStudio3.5/
and read the idea.log file.
java.lang.NoClassDefFoundError:
org/gradle/wrapper/WrapperConfiguration
It seems like WrapperConfiguration class couldn't be found. Try these commands:
brew install gradle
gradle wrapper
The second line will install wrapper class. And then,
gradlew clean
Recently I had to switch to Android Studio 3.2 Canary to use the new AndroidX components.
My main development environment is Mac/OSX and everything works fine. However, this week I had to switch to Windows and when compiling the apk I'm getting the below exception.
As I'm using AndroidX, had to enable in gradle.properties file:
android.enableJetifier=true
android.useAndroidX=true
Here's the exception.
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\rafael.chagas\.gradle\caches\transforms-1\files-1.1\jetified-play-services-basement-15.0.1.aar\a98f8e9d46ed106e8653ab19e7672193\jars\classes.jar
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:877)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.lambda$convertToDexArchive$7(DexArchiveBuilderTransform.java:802)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing.
at com.android.builder.dexing.D8DexArchiveBuilder.getExceptionToRethrow(D8DexArchiveBuilder.java:124)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:101)
at com.android.build.gradle.internal.transforms.DexArchiveBuilderTransform.launchProcessing(DexArchiveBuilderTransform.java:872)
... 6 more
Caused by: java.lang.NullPointerException: entry
at java.util.zip.ZipFile.getInputStream(ZipFile.java:346)
at com.android.tools.r8.ArchiveClassFileProvider.getProgramResource(ArchiveClassFileProvider.java:91)
at com.android.builder.dexing.r8.CachingArchiveClassFileProvider.lambda$getProgramResource$0(CachingArchiveClassFileProvider.java:38)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at com.android.builder.dexing.r8.CachingArchiveClassFileProvider.getProgramResource(CachingArchiveClassFileProvider.java:38)
at com.android.builder.dexing.r8.ClassFileProviderFactory$OrderedClassFileResourceProvider.getProgramResource(ClassFileProviderFactory.java:78)
at com.android.tools.r8.utils.ClassProvider$ClassFileResourceReader.collectClass(ClassProvider.java:97)
at com.android.tools.r8.utils.ClassMap$ConcurrentClassLoader.get(ClassMap.java:241)
at com.android.tools.r8.utils.ClassMap$ConcurrentClassLoader.get(ClassMap.java:217)
at com.android.tools.r8.utils.ClassMap.get(ClassMap.java:115)
at com.android.tools.r8.graph.LazyLoadedDexApplication.definitionFor(LazyLoadedDexApplication.java:47)
at com.android.tools.r8.graph.AppInfo.definitionFor(AppInfo.java:62)
at com.android.tools.r8.ir.desugar.InterfaceMethodRewriter.findDefinitionFor(InterfaceMethodRewriter.java:255)
at com.android.tools.r8.ir.desugar.InterfaceMethodRewriter.rewriteMethodReferences(InterfaceMethodRewriter.java:140)
at com.android.tools.r8.ir.conversion.IRConverter.rewriteCode(IRConverter.java:675)
at com.android.tools.r8.ir.conversion.IRConverter.convertMethodToDex(IRConverter.java:346)
at com.android.tools.r8.graph.DexClass.forEachMethodThrowing(DexClass.java:132)
at com.android.tools.r8.ir.conversion.IRConverter.lambda$convertClassesToDex$2(IRConverter.java:332)
at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:117)
at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:38)
at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:260)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:66)
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:36)
at com.android.tools.r8.ir.conversion.IRConverter.convertClassesToDex(IRConverter.java:330)
at com.android.tools.r8.ir.conversion.IRConverter.convertToDex(IRConverter.java:245)
at com.android.tools.r8.D8.optimize(D8.java:202)
at com.android.tools.r8.D8.run(D8.java:162)
at com.android.tools.r8.D8.lambda$run$1(D8.java:92)
at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:56)
at com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:41)
at com.android.tools.r8.D8.run(D8.java:89)
at com.android.builder.dexing.D8DexArchiveBuilder.convert(D8DexArchiveBuilder.java:99)
The target .jar file above is random. It may fail with any of the project libraries.
I know that this is a Canary release of Android Studio, but what intrigues me is that this only occurs with Windows OS. Tested in Linux, OSX and had no problems at all.
Thanks!
Finally I found the root cause and fix to this issue.
Looking into the error messages, the Android R8 class causing the exception was:
src/main/java/com/android/tools/r8/ArchiveClassFileProvider.java
Digging into R8 source i found the latest logs and a brand new commit that changes the encoding while reading .zip files:
https://r8.googlesource.com/r8/+/a26659a1d07b4dc4ad0c3f8dbafd47d49efbc438
This commit changes the way R8 reads zip archives using UTF-8 encoding and avoid using the platform encoding. That's why only Windows was failing.
I tested the latest R8 release with that commit and it worked! Just need to add these (+) lines to your project build.gradle file.
repositories {
google()
jcenter()
+ maven {
+ url "http://storage.googleapis.com/r8-releases/raw"
+ }
}
dependencies {
+ classpath 'com.android.tools:r8:1.2.28'
classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
classpath 'com.google.gms:google-services:4.0.0'
}
The "com.android.tools:r8:1.2.28" must be the first one in the dependencies.
According to the BUG 109992855 that new version of R8 will be pushed to Android Studio 3.2 in about two weeks. Meanwhile you must use the above fix.
Hope that helps anyone who stumbled on this error.
After updating to Android Studio from 3.0.1 to 3.1, and updating all plugins and SDK tools i am no longer able to debug my native application.
The error is 'Execution finished' (ExecutionFinishedException) which is raised in LLDB.
LLDB version is 3.1.4508709 (which is the latest).
If i try and debug with an earlier version of LLDB i get an error LLDB is missing (or similar).
Error details:
Execution finished
com.intellij.execution.ExecutionException: Execution finished
at com.jetbrains.cidr.execution.ExecutionResult.get(ExecutionResult.java:38)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.getProtobufClient(LLDBDriver.java:90)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.executeConsoleCommand(LLDBDriver.java:1109)
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.executeConsoleCommand(LLDBDriver.java:1103)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.loadStartupScripts(AndroidLLDBDriver.java:321)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.commonLoad(AndroidLLDBDriver.java:132)
at com.android.tools.ndk.run.lldb.AndroidLLDBDriver.loadForAttach(AndroidLLDBDriver.java:248)
at com.android.tools.ndk.run.AndroidNativeAppDebugProcess.prepareTarget(AndroidNativeAppDebugProcess.java:101)
at com.android.tools.ndk.run.AndroidNativeDebugProcessImpl.doLoadTarget(AndroidNativeDebugProcessImpl.java:123)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess.lambda$start$0(CidrDebugProcess.java:314)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:703)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:693)
at com.intellij.util.concurrency.QueueProcessor.lambda$null$0(QueueProcessor.java:93)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.concurrency.QueueProcessor.lambda$wrappingProcessor$1(QueueProcessor.java:93)
at com.intellij.util.concurrency.QueueProcessor.lambda$null$3(QueueProcessor.java:226)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.concurrency.QueueProcessor.lambda$startProcessing$4(QueueProcessor.java:226)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.intellij.execution.ExecutionFinishedException: Execution finished
at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$4.processTerminated(LLDBDriver.java:248)
at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:239)
at com.sun.proxy.$Proxy16.processTerminated(Unknown Source)
at com.intellij.execution.process.ProcessHandler$4.run(ProcessHandler.java:196)
at com.intellij.execution.process.ProcessHandler$TasksRunner.execute(ProcessHandler.java:272)
at com.intellij.execution.process.ProcessHandler.notifyTerminated(ProcessHandler.java:177)
at com.intellij.execution.process.ProcessHandler.notifyProcessTerminated(ProcessHandler.java:173)
at com.intellij.execution.process.BaseOSProcessHandler.onOSProcessTerminated(BaseOSProcessHandler.java:192)
at com.intellij.execution.process.OSProcessHandler.onOSProcessTerminated(OSProcessHandler.java:89)
at com.intellij.execution.process.BaseOSProcessHandler$2$1.consume(BaseOSProcessHandler.java:155)
at com.intellij.execution.process.BaseOSProcessHandler$2$1.consume(BaseOSProcessHandler.java:140)
at com.intellij.execution.process.ProcessWaitFor$1.run(ProcessWaitFor.java:66)
... 5 more
Last 2 lines from gdb-server log:
1522263876.330623627 NativeProcessLinux.cpp:MonitorCallback got exit signal(0x002EA90B) , tid = 25279 (is not main thread)
1522263876.330640793 NativeProcessLinux.cpp:MonitorCallback tid = 25279 handling non-main thread exit (%s)
Anyone else experienced this or know of a fix?
A workaround is to re-install Android Studio 3.0.1. This can be done alongside the latest version (see https://developer.android.com/studio/preview/install-preview.html).
For me, debugging c++ code then works again (in Android Studio 3.0.1) even though it is using the same versions of SDK tools (e.g. LLDB v3.1.4508709).