After updating Android studio library I cannot run or build project - android

I update my android studio 2.0 to latest 2.1.1 Also I update my sdk and install all required sdk elements.
After that when I run my existing working project then it give me bellow issue.
Error:Execution failed for task ':lib-toolbarindicator:processReleaseResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/tristate/oldSdk/android-sdk-linux/build-tools/24.0.0/aapt'' finished with non-zero exit value 2
This error occur in messages tab. so I cannot go further in project.
Forgive me spieling mistake and grammatical mistake because I am not native in English.
Thank you

Try to Clean up Your Project.
I often get Error but With Just One Clean shot, BUILD SUCCESSFUL

Please change your build.gradel file then sync android because this type of error comes due to unnecessary complie library in build.gradel.
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}

Related

A problem occurred starting process 'command '\Android Studio\jre\bin\java.exe''

After spending two days still not figured out what's happening.
I'm getting below error while building the App after merging the code.
com.android.build.api.transform.TransformException:
org.gradle.process.internal.ExecException: A problem occurred starting
process 'command 'C:\Program Files\Android\Android
Studio\jre\bin\java.exe''
This is happening in a specific git branch. the same project runs successfully from another branch.
What I have tried so far:
Uninstalled Android Studio and reinstalled v3.1.3
Also updated to latest Android Studio v3.3.2
Still getting the same error!
Try adding multiDexEnabled true to your app build.gradle file.
defaultConfig {
multiDexEnabled true
}
Also add following dependency :
dependencies {
implementation 'com.android.support:multidex:1.0.3'
}
Hope it helps.

how to avoid a particular task in gradle when building through command line

I wanted to build an android project by running gradle build but I am getting this error
Execution failed for task ':processDebugResources'
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/Users/abc/Library/Android/sdk/build-tools/24.0.1/aapt'' finished
with non-zero exit value 1
how can i avoid gradle to run this particular task ??
The most straightforward way is to use the -x or --exclude-task options. You can read about it in the official docs here.
You just nee to run you build as follows:
gradle build --exclude-task processDebugResources
Although this could be an option, I'm not sure, whether it's a good solution, because just skipping some task doesn't solve a root problem, which caused your build failure.
You can try to solve the problem by cleaning and rebuilding the project. If this won't help, you can also try to update Android SDK build tool in your SDK manager and updating buildToolsVersion in your build.gradle script.

How do I add an 'aar' to my existing android project in Android Studio

I have a aar module by the name of app-debug.aar. I need to add this in my existing android project. I am using Android Studio 1.2.2. I have tried lot of approaches which were suggested like these
How to manually include external aar package using new Gradle Android Build System
When I am trying to use the answers in this post, I mostly come across this issue
Error:Execution failed for task ':app:processIcanpayDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/Shaik/Library/Android/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 1
And when I seacrched for that i came to know that I had to add
defaultConfig {
multiDexEnabled true
}
But still I get the same error and I am not successful in adding the aar module to my project. Can anyone let me know how can I achieve it. Thanks in advance.
I think you're looking for something like this (works for me): http://kevinpelgrims.com/blog/2014/05/18/reference-a-local-aar-in-your-android-project/

Android Project imported in android studio giving exception

I imported an eclipse project in android studio.
On running the app, its giving the below error.
As suggested in some links, I run the command 'gradlew.bat clear' and after that restarted my android studio, but it didn't worked.
Please help me out
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with non-zero exit value 2
Look if you have duplicates in gradle settings like this:
compile 'com.google.android.gms:play-services:+'
compile files('libs/google-play-services.jar')
that could also cause this issue. Remove one of lines if you have this.
changing java version to 1.7 and deleting concerning libs files helped me getting rid of the above exception.
I changed the target version in my build.gradle file from targetSdkVersion 22 to targetSdkVersion 23 as i was using compileSdkVersion 23. The error went away and the app ran successfully after syncing ad rebuilding. hope this helps someone

How can I add a dependency to my Android project without getting an error?

I want to create an Android Library module and make that a dependency of my current project. I've tried the answer of the following question: How to create a library project in Android Studio and an application project that uses the library project
When I tried to run my app, the following message showed up:
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_05\bin\java.exe'' finished with non-zero exit value 1
I'm using Android SDK tools 24.1.2. What could be wrong?
Changing (installing) the JDK location to C:\Program Files\Java\jdk1.7.0_67 solved the problem for me.

Categories

Resources