Error:Execution failed for task ':app:preDexRelease' - android-studio

I get this error code when I generate a key when I try make a APK.... it debugs without error but shows this when I try to publish the APK .... Driving me isane...ANY IDEAS would be great! Thank in advance.
Please show in Hirachy where I need to fix please I new with Studio!
Error:Execution failed for task ':app:preDexRelease'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files\Android\android-studio\sdk\build-tools\21.0.2\dx.bat --dex --output C:\Users\dunn\AndroidstudioProjects\TheCityScenes\app\build\intermediates\pre-dexed\release\GoogleAdMobAdsSdk-4.1.0-b731e64f1aad819519b8bd32bacb9d953860eaf5.jar C:\Users\dunn\AndroidstudioProjects\TheCityScenes\app\libs\GoogleAdMobAdsSdk-4.1.0.jar
Error Code:
1

This is probably due to low RAM memory when building the apk. Please check your amount of memory, clear it up and try again.

Related

Recource compilation failed

I faced with error today and I can't fix it. please help me it's drive me crazy.
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing
com.android.build.gradle.internal.res.ResourceCompilerRunnable
> Resource compilation failed. Check logs for details.
I've tried "clean code" and rebuild project and invalidate cache and restart. I also delete the idea.xml.but none of these didn't work

Android app not executed . Please help me out from this problem

During Rebuild Project following error message shown in Logcat
Task :app:dataBindingGenBaseClassesDebug FAILED
no info log is passed. There are no resources?
Execution failed for task ':app:dataBindingGenBaseClassesDebug'.
Parameter 'directory' is not a directory
Use this command
./gradlew assembleDebug --rerun-tasks

Gradle Problem When Importing Flutter Project From Git

I imported a Flutter Project from this git repo: https://github.com/gligerglg/geodropin (website: https://itsallwidgets.com/geodropin) by copying the HTTPS, then go to Android Studio -> Check out Project from Version Control -> Git. When I open the project and try to run, this error appear:
* Error running Gradle:
ProcessException: Process "/Users/phuctruong/AndroidStudioProjects/geodropin/android/gradlew" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/phuctruong/AndroidStudioProjects/geodropin/android/app/build.gradle' line: 45
* What went wrong:
A problem occurred evaluating project ':app'.
> For input string: "1.01"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Command: /Users/phuctruong/AndroidStudioProjects/geodropin/android/gradlew app:properties
Finished with error: Please review your Gradle project setup in the android/ folder.
I assume this has something to do with my gradle version and the project's gradle version? I'm a newbie to Flutter so my understanding of gradle is limited. When I check gradle-wrapper.property it said i'm using gradle 4.10.2
Thanks for helping.
Check out the 16th line of app/build.gradle you will see that the number in a string is of float type. VersionCode should always be integer. Check this out https://developer.android.com/studio/publish/versioning
You can remove this error by just changing it to positive integer value like this :
flutterVersionCode = '1'
Now this problem is resolved but however you will get another error related to androidX but thats different question.
Error would be :
BUILD FAILED in 10s
******************************************************************************************* The Gradle failure may have been because of AndroidX incompatibilities
in this Flutter app. See link for more information on
the problem and how to fix it.
******************************************************************************************* Finished with error: Gradle task assembleDebug failed with exit code 1
For this issue you need to migrate the project to androidX,
add it in android/gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
Or if its already there, Check this migration docs for more info.
Or nothing works, you can ask another question.

Running JHipster gradlew fails on ':bower' task

I am trying to run ./gradlew in jhipster project and getting next error with ':bower' task:
:cleanResources
:bootBuildInfo
:bower FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bower'.
> A problem occurred starting process 'command 'bower''
.......
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'bower'
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.run(ExecHandleRunner.java:68)
... 2 more
Caused by: java.io.IOException: Cannot run program "bower" (in directory "/Users/vovkvlad/coding/learning/Java/jHipProj"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 4 more
I have seen similar problems on stackoverflow:
Running JHipster Gradle task from Intellij IDEA
jhipster - error executing task :bower
But first link complains only about failure in IntelliJ (and in my case the same error occurs in the terminal)
And second link gives pretty strange answer with removing node which seems strange to me, and may be not applicable since 2 years have past.
So, do anyone have a key to what am I doing wrong?
I will be grateful for any kind of help/hint.
Thanks in advance for help!
EDIT: I have bower installed globally, so that it can be found under one of the paths in $PATH. And bower is recognized from the terminal.
I was having this same issue. I was able to fix it by stopping the gradle daemon using ./gradlew --stop. Here is a link to a post where I found the solution.
i got the same issue, and fixed it with command below.
gradle --stop
In my case, i use Eclipse with Buildship plugin, it starts a Grade Daemon to build project by itself, and the classpath of NodeJS & Bower is difference when running application in terminal.

Issues cleaning my project and importing R after update

I just updated Android Studio (0.8.14) and got bombarded with various errors.
When I try to clean my project, I get this:
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: C:\Users\----\Documents\Android Projects\----\app\build\intermediates
Every class that imports com.myorg.myproject.R says:
Cannot resolve symbol 'R'.
I checked my androidmanifest and it's referencing the package correctly. Any idea how to fix this?
gradlew clean in the terminal works without error, but the clean function from the Build menu throws this error.
C:\Users\----\Documents\Android Projects\---->gradlew clean
:app:clean
BUILD SUCCESSFUL
Total time: 5.43 secs
Thanks

Resources