App build error # Caused by: org.gradle.workers.internal - android

I am facing this error while building the application
# Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
Please help me whats the wrong

Related

Gradle project sync failed in Flutter project

Every time my gradle is syncing it gets errors like this. Can someone help me?
Error cause after adding firebase_ml_vision dependency.
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
Caused by: java.lang.RuntimeException: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'.
Caused by: com.android.build.gradle.internal.crash.ExternalApiUsageException: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'.
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':app:packLibsflutterBuildDebug'.
org.codehaus.groovy.runtime.metaclass.MissingMethodExecutionFailed: No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir() is applicable for argument types: (File) values: [C:\Users\37499\AndroidStudioProjects\flutter_ml_demo\build\app\intermediates\flutter\debug]
I tried changing gradle, java and firebase versions but that don't help.

Update Gradle to Version 7.0.2

Updating Gradle from version 4.2.0 to 7.0.2. ended up in an error during minifying with R8. (Using Java 1.8)
Unfortunately, the error message is not very telling (see below).
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at Version.fakeStackEntry(Version_3.0.69.java:0)
at com.android.tools.r8.utils.w.a(SourceFile:68)
at com.android.tools.r8.utils.w.a(SourceFile:28)
at com.android.tools.r8.utils.w.a(SourceFile:27)
at com.android.tools.r8.R8.a(R8.java:29)
at com.android.tools.r8.R8.run(R8.java:3)
at com.android.builder.dexing.R8Tool.runR8(r8Tool.kt:301)
at com.android.build.gradle.internal.tasks.R8Task$Companion.shrink(R8Task.kt:592)
at com.android.build.gradle.internal.tasks.R8Task.doTaskAction(R8Task.kt:443)
at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(BaseTask.kt:63)
at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:51)
at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:94)
at jdk.internal.reflect.GeneratedMethodAccessor512.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
... 118 more
Caused by: java.lang.NullPointerException: Cannot invoke "com.android.tools.r8.graph.B.F()" because "<parameter1>" is null
Did anybody face / solve the same problem?

LibGDX game crash after migrating to Android Studio 3.4

After migrating to Android Studio 3.4, the game now crashed. It works fine on 3.3. What does this mean?
org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures.
at
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:transformDexWithInstantRunSlicesApkForDebug'
...
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/limtc/AndroidStudioProjects/Space War/android/build/intermediates/instant_run_split_apk_resources/debug/instantRunSplitApkResourcesDebug/out/slice_1/resources_ap
,,,
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /Users/limtc/AndroidStudioProjects/Space War/android/build/intermediates/instant_run_split_apk_resources/debug/instantRunSplitApkResourcesDebug/out/slice_1/resources_ap
...
Caused by: java.io.FileNotFoundException: /Users/limtc/AndroidStudioProjects/Space War/android/build/intermediates/instant_run_split_apk_resources/debug/instantRunSplitApkResourcesDebug/out/slice_1/resources_ap
...
After switching off instant run, I can now deploy to phone! But trying to generate bundle I now have:
org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures.
...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':android:lintVitalRelease'
...
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':android:lintClassPath'.
...
Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not download groovy-all.jar
Maybe now something goes offline? Thanks!
Based on the messages:
java.io.FileNotFoundException: /.../instant_run_split_apk_resources
I'd say, try disabling Instant Run.

D8 DexMergerTransform: flaky android builds on gitlab-ci

Since several days, I see flaky builds on my GitLab CI system.
Sometimes the build fails with this error:
Caused by: com.android.build.api.transform.TransformException: java.lang.IllegalArgumentException
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:230)
When I then retry the build once or twice it works.
I know, this may be difficult to answer, so please add some comments, what I could try or which additional info you would need (unfortunately the project is not open-source): all comments/ideas are welcome.
Here are some thoughts that I have in mind:
maybe this is caused by insufficient memory (it's a quite large multi-module build)
maybe a timing issue of the build
maybe an error in the D8 Dexer
some more info:
the build is not doing any fancy stuff (android UI tests, etc.).
It just executes ./gradlew assembleDebug
com.android.tools.build:gradle 3.0.1
CompileSdkVersion: 26
Here are some relevant parts of the build-log:
> com.android.build.api.transform.TransformException: java.lang.IllegalArgumentException
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':m10_android_apk:transformDexArchiveWithDexMergerForRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.IllegalArgumentException
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
Caused by: com.android.build.api.transform.TransformException: java.lang.IllegalArgumentException
at com.android.build.gradle.internal.transforms.DexMergerTransform.transform(DexMergerTransform.java:230)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 116 more
Caused by: java.lang.IllegalArgumentException
at com.android.tools.r8.utils.ThreadUtils.getExecutorService(ThreadUtils.java:40)
at com.android.tools.r8.D8.runForTesting(D8.java:150)
at com.android.tools.r8.D8.run(D8.java:71)
at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:73)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:97)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:35)

Error Gradle when generate apk in Android Studio: Exception parsing classes

I have a problem when I generate signed Apk file in Android studio. I get a messages below:
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
:app:transformClassesWithDexForRelease FAILED
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_67\bin\java.exe'' finished with non-zero exit value 1
I use proguard in build gradle:
classpath 'com.android.tools.build:gradle:2.1.0'
I was searching through many existing answers, but it's not worked.
I refer this topic, but i can not find anything like this.
When try to use gradlew assembleRelease, I find the message:
Cause: java.lang.RuntimeException: Exception parsing classes
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
at com.android.dx.command.dexer.Main.processClass(Main.java:761)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:727)
at com.android.dx.command.dexer.Main.access$1200(Main.java:87)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1655)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:681)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:578)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.run(Main.java:286)
at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:52)
at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1511)
at com.android.builder.core.AndroidBuilder$2.call(AndroidBuilder.java:1507)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.dx.cf.iface.ParseException: name already added: string{"a"}
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.java:156)
at com.android.dx.cf.direct.AttributeListParser.parseIfNecessary(AttributeListParser.java:115)
at com.android.dx.cf.direct.AttributeListParser.getEndOffset(AttributeListParser.java:96)
at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:213)
at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
at com.android.dx.cf.direct.FieldListParser.getList(FieldListParser.java:54)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:536)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:773)
at com.android.dx.command.dexer.Main.access$1600(Main.java:87)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1694)
at com.android.dx.command.dexer.Main.processClass(Main.java:758)
... 17 more
Caused by: java.lang.IllegalArgumentException: name already added: string{"a"}
at com.android.dx.rop.annotation.Annotation.add(Annotation.java:208)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotation(AnnotationParser.java:264)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationParser.java:223)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(AnnotationParser.java:152)
at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(StdAttributeFactory.java:632)
at com.android.dx.cf.direct.AnnotationParser.parseAnnotations(AnnotationPa
at com.android.dx.cf.direct.AnnotationParser.parseAnnotationAttribute(Anno
at com.android.dx.cf.direct.StdAttributeFactory.runtimeVisibleAnnotations(
at com.android.dx.cf.direct.StdAttributeFactory.parse0(StdAttributeFactory
at com.android.dx.cf.direct.AttributeFactory.parse(AttributeFactory.java:9
at com.android.dx.cf.direct.AttributeListParser.parse(AttributeListParser.
... 30 more
1 error; aborting
:app:transformClassesWithDexForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.proce
s.ProcessException: Return code 1 for dex process
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug op
BUILD FAILED
I tried create new project and copy all gradle, proguard-pro and it build ok.
I don't know why?
What can be other possible solution please ?

Categories

Resources