I have a problem with my android studio when I build an apk of an opensource project openshop.io, something is on a LegacyDebug task with Gradle,I also tried removing java and android studio and installing a fresh ones java 1.7 and 1.8 both the latest android studio 2.2 with android 15 API and 23 API,24 API , also tried many of researches and solutions here but none of them works in my laptop (I have a windows 10 32 bit 4GB Ram memory), also when I try the same project on my friends laptops the build apk works perfect with no changes on project but in mine not, here is the error in my android studio:
Error:Execution failed for task ':app:transformClassesWithDexForLegacyDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
this error showes up on this task which failed to run:
Information:Gradle tasks [installLegacyDebug]
Related
I know this question exists a lot on StackOverflow but none of the solutions I found seem to work.
The problem
Run without project or with android project
I ofcourse need to select the correct API version but the AVD starts without any problem.
Run with flutter project
I get the error message "unable to locate adb" when starting up the AVD. The device boots anyway and I can run my apps on it but the error is annoying so I would like to get rid of it.
Also when i open the build.gradel file, I get the warning that the sync failed (see image below). When looking in the logs, I see again a lot of: 2020-11-06 14:50:31,561 [4185024] INFO - .deployment.AsyncDevicesGetter - adb not found
What I have tried
check the adb.exe file in appdate (however that could not be the problem since it works with an android project)
use 3 different api versions:28, 29, 30 (in the gradel file I see minSdkVersion 21 and targetSdkVersion 29)
resolve errors in build.gradle: GradleNotFoundException became FileNotFoundException
About Android studio:
Android Studio 4.1
Build #AI-201.8743.12.41.6858069, built on September 23, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
I had been developing a flutter mobile app for a couple of months and all was good. I just came back to the project and a few things (flutter, dart, android studio etc) upgraded. Now I can't compile my app. I created a new flutter app (the default example) and that won't compile either.
The error I'm getting is :
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings remapped class cache for bq3hllkgb26p0nrblf5gh8d37 (C:\Users\Paul\.gradle\caches\5.6.2\scripts-remapped\settings_cbd968glg60byp9f5t6vvdlee\bq3hllkgb26p0nrblf5gh8d37\settings8410a2d21ed2f87c8a0398566330ee52).
> Could not open settings generic class cache for settings file 'D:\Apps\Flutter\Examples\flutter_app\android\settings.gradle' (C:\Users\Paul\.gradle\caches\5.6.2\scripts\bq3hllkgb26p0nrblf5gh8d37\settings\settings8410a2d21ed2f87c8a0398566330ee52).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 57
I am running:
Flutter 1.20.2
Dart 2.9.1
Android Studio 4.1
Java 1.8.0_261
JVM 13.0.2
Gradle 6.7
Windows 10
Try running
flutter stable
flutter clean
flutter downgrade
cd <Your App Folder>
and then
flutter run
in command line
I ended up completely removing Flutter from my system and then re-installed it. This fixed everything.
[Click here to see screenshot]
1]Just installed android studio 4.0 on Ubuntu 20.04 ... And I tried to start a new project from examples that are present ... But immediately it load into the project page the build process failed with error 03 or so
Since I upgraded to Android Studio Canary 5 I have had issues with Instant Run, it gives me the following error when Instant Run is Enable:
Information:Gradle tasks [:app:assembleDebug]
Error:C:\..etc.\app\build\intermediates\instant-run-support\debug\dependencies\AndroidManifest.xml:2 resource string/app_build_version_name (aka com.itbackyard.iels.client:string/app_build_version_name) not found
Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:com.android.ide.common.process.ProcessException: Failed to execute aapt
Error:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Information:BUILD FAILED in 1m 29s
Information:8 errors
Information:0 warnings
Information:See complete output in console
My only solution was to disable Instant Run from settings. What I was able to find is this topic with out solution so far.
Any idea if this is still a bug or is there any work around till it gets fixed?
Here is my version information:
Android Studio 3.0 Canary 5
Build #AI-171.4141229, built on June 28, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Edit
I have now updated to
Android Studio 3.0 Canary 6
Build #AI-171.4163606, built on July 7, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
And updated to Canary 7
Android Studio 3.0 Canary 7
Build #AI-171.4182969, built on July 14, 2017
JRE: 1.8.0_152-release-884-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Still the same problem.
Add this line gradle.properties file. it work for me
android.enableAapt2=false
Android Studio 3.0 Canary 5
If your build fails due to resource processing issue. To temporarily disable AAPT, set android.enableAapt2=false in your gradle.properties file.
I solved this way:
What I did is creating an empty new project in Android Studio 3.0 Canary 7, it does not have this behavior. I compared the new empty project default build.gradle (Module: app) with my existing project that has the mentioned problem.
Off course this can differs from case to case, but in my case, I used a variable to update versionName and it worked previously with out any issues, but not on Andriod Studio 3. Therefore I corrected the line, Sync and Rebuild the problem was gone.
This is the complete error from Android Studio 2.1.1. I know this code compiles because on other PC it does, just not on this one which has Windows 10 x64. All other projects fail with similar result.
Error:Execution failed for task ':app:compileDebugJavaWithJack'.
> java.lang.RuntimeException: java.lang.AssertionError: com.android.jack.library.LibraryIOException: I/O error when accessing file 'I:\Android\KeepVidDownloader\Android\app\build\intermediates\packaged\debug\classes.zip': Failed to delete directory 'C:\Users\BCDIAC~1\AppData\Local\Temp\vfs-1464787788985-0'
For Build -> Clean Project I have used the solution from here https://stackoverflow.com/a/32924320/1958032
I think that there could be a similar solution for running/making the app.
How to solve this?
This issue is a conflict between antivirus and Android Studio.
In my case using Avira, Windows 10 and Android Studio 2.2.
I just disabled Avira for the first build and enabled it again when build was complete.
No need to do this every time- only at the first build.
I had a similar problem and solved it by File->Invalidate Caches and Restart.