HtmlUnit in android error : Execution failed for task : 'app:preDexDebug' - android

I am trying to perform a click activity on a web page and get the response using HtmlUnit in Android. (I don't want user to be knowing this activity. So, I am trying to use HtmlUnit or Selenium).
So, I tried initially to to use WebClient present in html unit. But when I try to run the app, I get an error :
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_20\bin\java.exe'' finished with non-zero exit value 1
Please share your ideas to resolve the issue.
Sample Code :
final WebClient webClient=new WebClient();
final HtmlPage page=webClient.getPage("http://www.google.com");

Just clean project and rebuild project.
If still error try this in your build.gradle(Module: app).
android {
...
defaultConfig {
...
multiDexEnabled true
}
}

Related

I have got this error while running non-zero exit value 1

Error:(51) Error parsing XML: no element found
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\tariq ziad\AppData\Local\Android\Sdk\build-tools\24.0.0\aapt.exe'' finished with non-zero exit value 1
in my content main file, there is an error showing, "unexpected end of file" last thing is a button. I dont know whats missing? Please someone check it out.
It's general problem to me also. It happens when the external device is not able to update your app when you run the app. Try uninstalling the installed app and install again. If problem persist please provide full logcat result.

Android Jetty Framework: "Parse Error: Unsupported class file version 52.0"

I am working on an android application in android studio as a university project. We have just started android developement this week so I quite new to it.
We have the following error when we try to compile our app:
Error:PARSE ERROR:
Error:unsupported class file version 52.0
Error:...while parsing org/eclipse/jetty/webapp/AbstractConfiguration.class
Error:1 error; aborting
:app:transformClassesWithDexForDebug FAILED
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: 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.8.0_65\bin\java.exe'' finished with non-zero exit value 1
It sounds like it's a problem with on of our libarys but we couldn't figure it out. So I created a completly new app with just the "Hello World" label in it.
I imported the GSON Library then and everything is still working. I didnt change anything in the app and just kept the "Hello World" stuff so it is a completly new app. But as soon as I import the Jetty libarys I get this error so it must be a problem with the library!
What is that problem and how can I fix it?

Sudden appearence of debug/AndroidManifest, execution failed for task:app:processDebugResources

I recently connected my mobile device up to android studio in order to attempt a build on a real device, before this, everything was working fine. However, the debug manifest is now showing some strange issues.
For example, the android version code and version name is coming up red, as are the config changes and the theme.
The actual error is:
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\bembe_000\AppData\Local\Android\sdk1\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1

Unable to set layout background from drawable

I'm unable to set my MainActivity background from a drawable image:
android:background="#drawable/loli"
loli is my drawable name. Actually nothing special, just the usual to get a simple background. When I use it my xml, I'm getting this error while running:
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/firas/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 42
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/firas/AndroidStudioProjects/NeverLost/app/src/main/res/drawable/back.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/firas/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 42
This can happen when gradle fails to process resources. In your case it may have happened to be an invalid image file in the drawable folder.
Please check both ways
1> check your extension & convert them .png into .jpeg
2> if that useless then delete from drawable
Please visit Android Studio Error: org.gradle.process.internal.ExecException or this link for more help Android Studio crash (aapt.exe returns 42) when I put PNG file in drawable folder
Try cleaning/rebuilding your project.
Build > Clean Project or Build > Rebuild Project
Thank you everyone for your answers
the links you provide me were very useful (first one).
actually the problem was not changing the image extension .
because I was saving .jpeg extensions as .png from google image
I think it's much suitable to keep the default extension .
At least that worked for me

Cannot start my application after a android studio update

After a android studio update I can't start my application anymore. Everytime I'm getting this err:
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
I tried these solutions:
Android Studio : com.android.ide.common.process.ProcessException:
Can not import Google play service 7.0.0
Still the same error. Anybody knows what I can do?
Answer in the comments above! This worked for me:
defaultConfig {
multiDexEnabled true
}

Categories

Resources