I cannot install my application in my mobile using Flutter - android-studio

I have set proper paths and installed plugins (Dart and Flutter) in my Android Studio but I have always seemed this error below and same in Visual Studio Code?
Downloading Gradle Wrapper... 0.6s
Launching lib\main.dart on RMX1971 in debug mode...
Running Gradle task 'assembleDebug'...
Downloading Gradle Wrapper... 0.6s
Exception: Gradle task assembleDebug failed with exit code -1

Please Check
Android Studio -> New -> ProjectStructure -> Modules.
Please check the full Project Structure.
I hope it helps.

Related

The specified Gradle installation directory does not exist error after Android Studio update 2021 1 1 patch2

After updating Android studio, my project now throws error The specified Gradle installation directory 'C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1' does not exist.
When checking that installation path, there is no gradle folder.
I also tested a sample project, and that seems to be working.
Update: found the solution in this comment: How to update gradle in android studio?
I have solved like this:
You'll:
In Android Studio -> File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
In "Use Gradle from" you choose 'gradle-wrapper.properties' file. And in Gradle JDK you choose what you need.

Android studio 3.6 issue : ApkProvisionException: No outputs for the main artifact of variant: debug

Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug
when update to android studio 3.6 version, this issue come out, but 3.5 is ok at the same project.
And I can find the apk in the outputs/apk folder.
I have the same issue with a Cordova Project after I updated Android Studio to 3.6.1
As a workaround (at least for the first installation of the app) I use installDebug Gradle Task from Gradle Tab View -> Tasks -> Install
I also have issues with Build -> Build Apks so I use assembleRelease Gradle Task from Tasks -> build

Why are Jenkins and Android Studio having different results on building an android project with gradle?

I am working on a jenkins build server for an android project that uses gradle as build-tool.
The jenkins job checkouts the same git branch as my android studio project and tries to build but fails at one point whereas when I build the project with android studio, I do not get any errors. Where could be reason for this?
Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
C:\Windows\System32\config\systemprofile.gradle\caches\transforms-2\files-2.1\9fe834a1339d0af409079f662a365996\res\drawable\abc_btn_colored_material.xml: error: file not found.
There is no error when I build the project with android studio :(

Error on android studio 2.3.1

Gradle project sync failed when I'm running my project.
Close your recommended gradle than go use define path from setting of projects. ](https://i.stack.imgur.com/JqXt2.png)

Execution failed for app:clean in android studio 2.2

I currently switch to android studio 2.2 and I have a big problem. when I build project to deploy on emulator I got this error:
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: /mnt/D/Document/WorkSpace/Android/Test/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars
I clean that path and again it tell me that:
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: /mnt/D/Document/WorkSpace/Android/Test/app/build/intermediates/exploded-aar/com.android.support/cardview-v7/25.0.0/jars
I clean it handy and again:
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: /mnt/D/Document/WorkSpace/Android/Test/app/build/intermediates/exploded-aar/com.android.support/support-compat/25.0.0/jars/libs
I don't know how many steps exists and if I pass all these steps, may be I mentally!
I don't have these issues in android 1.4. is this a bug about android studio or related to my system(Arch Linux)?
Thanks in advance.
Disable Instant Run. It is in
File -> Settings -> Build,Execution -> Instant Run
This worked for me.
For me there was a stuck debug test inside of Android Studio and mockable-jar was used inside of that JVM and couldn't be deleted.
What I had to do is.. stop the frozen JVM from Task Manager, then clean.
What I'll do the next time this happens is.. stop the frozen debug test from Android Studio, then clean.
i finally fix it!
after:
apply plugin: 'com.android.application'
add this line of code to build.gradle(Module: app) file:
task clean(type: Delete) {
delete rootProject.buildDir
}
it will delete all jar and lib files from build your directory.
hope to enjoy :)

Resources