Android Studio Won't Build Projects - IDEs, Libraries, & Programming Tools

Hello,
I have made a few test projects and I am trying to build them, but I am getting Error 1 in the Messages window. The full error says:
Code:
Gradle: Execution failed for task ':HelloWorld:dexDebug'.
> Failed to run command:
C:\Users\Aaron\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat --dex --output C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\libs\HelloWorld-debug.dex C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\classes\debug C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\dependency-cache\debug C:\Users\Aaron\AppData\Local\Android\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\13.0.0\support-v4-13.0.0.jar
Error Code:
1
Output:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Can anybody help me out here? Is this because I am running Android Studio through studio.bat? It won't start through the proper icon, I get 'Failed to load JVM DLL', but my JDK_HOME and JAVA_HOME are both set up fine.
Thank you,
OrangeFlash81

Where do you have installed Eclipse? Try moving installation folder to something like C:\AndroidDev\eclipse
Sent from my LG-P350 using xda app-developers app

AS unstable
dbarrera said:
Where do you have installed Eclipse? Try moving installation folder to something like C:\AndroidDev\eclipse
Sent from my LG-P350 using xda app-developers app
Click to expand...
Click to collapse
He's not using Eclipse, he's using Android Studio. I've read many threads about the IDE differences and a general conclusion is that it's better to still use Eclipse for development because it is more stable so maybe you should try to setup your project in Eclipse for the time being @OrangeFlash81

Sorry, my bad.. I meant Studio installation path... I use Android Studio (Linux) daily without issues... In Windows I've seen most issues are because of Java and spaces in paths... Hence my recommendation is to place the IDE in a path without spaces...
Sent from my LG-P350 using xda app-developers app

I've completely given up with Android Studio now, I'm just goings back to Eclipse, which works fine.
Thanks for the help anyway!

Having some trouble with Android Studio? Have you take a look to my guide here? I hope it could helps.
By the way, for Android Studio installation. I recommend you not to install at C: partition, especially if you're using Windows 7. And for the directory, I think the advice not to put it in a directory with blank spaces is also worth considered too. If you have any problems with Android Studio, post it here. I'm glad to help. Don't give up to quickly! :highfive:
OrangeFlash81 said:
I've completely given up with Android Studio now, I'm just goings back to Eclipse, which works fine.
Thanks for the help anyway!
Click to expand...
Click to collapse

OrangeFlash81 said:
I've completely given up with Android Studio now, I'm just goings back to Eclipse, which works fine.
Thanks for the help anyway!
Click to expand...
Click to collapse
yes, me too. I think android studio is still in its early beta. My android studio won't launch after the first run. I tried reinstalled it again and again, this problem still linger. Leave me no choice but go back to eclipse.

Related

Need help with Eclipse

Hey guys i need some help.
I'm a newbie in this programming. I'm trying to learn about Android SDK and i'm learning through tutorials in the SDK website. The problem is, i'm having trouble opening xml files in Eclipse. When i double click the xml, the software will either crash or stopped responding.
Anyways I'm running Eclipse Helios on Win7 64bit. Any help?
JDK?
which JDK do you have?
install the 1.6
ezeygtr40 said:
Hey guys i need some help.
I'm a newbie in this programming. I'm trying to learn about Android SDK and i'm learning through tutorials in the SDK website. The problem is, i'm having trouble opening xml files in Eclipse. When i double click the xml, the software will either crash or stopped responding.
Anyways I'm running Eclipse Helios on Win7 64bit. Any help?
Click to expand...
Click to collapse
I got the same problems every time when I click on the string.xml.
Eclipse throw a java.lang.NullPointerException
Who can help me ?
Marinelli.Tv said:
I got the same problems every time when I click on the string.xml.
Eclipse throw a java.lang.NullPointerException
Who can help me ?
Click to expand...
Click to collapse
I found a solution for my problem.
Go Window -> Preferences
XML -> XML Files -> Editor
Uncheck "Use inferred grammar in absence of DTD/Schema"
Now I can edit XML files without errors !
Marinelli.Tv said:
I found a solution for my problem.
Go Window -> Preferences
XML -> XML Files -> Editor
Uncheck "Use inferred grammar in absence of DTD/Schema"
Now I can edit XML files without errors !
Click to expand...
Click to collapse
Tried ur method but still the same
learnandroid said:
which JDK do you have?
install the 1.6
Click to expand...
Click to collapse
I'm using JDK 6 update 21
Marinelli.Tv said:
I found a solution for my problem.
Go Window -> Preferences
XML -> XML Files -> Editor
Uncheck "Use inferred grammar in absence of DTD/Schema"
Now I can edit XML files without errors !
Click to expand...
Click to collapse
ezeygtr40 said:
Tried ur method but still the same
Click to expand...
Click to collapse
Although i setup eclipse a while back, i sitll remember i tried that and still got random freezing / null when editing xmls. My fix happened to be using a 32-bit eclipse with 64 bit jdk I know, but wht can i say, it works
Daneshm90 said:
Although i setup eclipse a while back, i sitll remember i tried that and still got random freezing / null when editing xmls. My fix happened to be using a 32-bit eclipse with 64 bit jdk I know, but wht can i say, it works
Click to expand...
Click to collapse
u mean i need to reinstall the eclipse with 32bit n 64bit jdk?
ezeygtr40 said:
u mean i need to reinstall the eclipse with 32bit n 64bit jdk?
Click to expand...
Click to collapse
Well is ur cpu 64 bit compatible? if so then yea that how mines setup n haven't had any errors.
Daneshm90 said:
Well is ur cpu 64 bit compatible? if so then yea that how mines setup n haven't had any errors.
Click to expand...
Click to collapse
yup i'm using AMD Anthlon 64 X2...currently i'm running eclipse 64bit with jdk 64bit
and another thing...in java webpage....between Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers and Eclipse Classic 3.6.0.....which 1 do i actually have to pick?
For java developers. For reference heres the version i have : jdk1.6.0_21
Good luck.
ezeygtr40 said:
Hey guys i need some help.
I'm a newbie in this programming. I'm trying to learn about Android SDK and i'm learning through tutorials in the SDK website. The problem is, i'm having trouble opening xml files in Eclipse. When i double click the xml, the software will either crash or stopped responding.
Anyways I'm running Eclipse Helios on Win7 64bit. Any help?
Click to expand...
Click to collapse
Fix is here:
http://www.eclipse.org/forums/index.php?t=msg&th=171988&start=0&
I chose the .ini method. In my case when I wanted to edit the manifest file - it would freeze on WIN7 - 64bit
scouzi said:
Fix is here:
http://www.eclipse.org/forums/index.php?t=msg&th=171988&start=0&
I chose the .ini method. In my case when I wanted to edit the manifest file - it would freeze on WIN7 - 64bit
Click to expand...
Click to collapse
Thanx i will give it a shot today
Sent from my Milestone using XDA App
scouzi said:
Fix is here:
http://www.eclipse.org/forums/index.php?t=msg&th=171988&start=0&
I chose the .ini method. In my case when I wanted to edit the manifest file - it would freeze on WIN7 - 64bit
Click to expand...
Click to collapse
WOW finally it worked!! I used the .ini method also...thanx man!
This is the crash i get
https://docs.google.com/file/d/0BwsES0K61ZeqcTRvWTJlMXJRX1k/edit?usp=sharing
I know its an issue between java and eclipse but it driving me friggin crazy, as if learning to program isnt difficult enough with out above poping up after tjhe "Java SE has stopped working" message.sorry if the link is weird it seems to be the way its linking on XDA to google drive.
I would love some help.
Thank you in advance.

Need help installing the Android SDK

I've read the other threads about this but there is no help to be found there unfortunately.
I've been playing with App Inventor because I wanted to avoid learning Java but my think now is that seeing as I do JavaScript/PHP/mySQL and HTML/CSS anyway I might as well do my app development properly.
I've been following the instructions at the official developer.android.com site.
and the part where I have the problem is with Eclipse - at step 1 on that page. I've installed the JDK but when I try to install Eclipse I get an error telling me that there is no Virtual Java machine in the eclipse\jre\bin\ folder.
Well I'm following the instructions so what can I do about this? I don't even understand the error. Is there supposed to be a file in this folder, a folder which a.doesn't come with the standard Eclipse .zip file and which b.doesn't exist at all!
I tried this all before some time ago and got the same problem. At that time I couldn't even use App Inventor because of some JDK/JRE problem but I un-installed and reinstalled Java and App Inventor is working now.
This is one of the most frustrating computing problems I've faced because I've searched all over for an answer and there is nothing out there. Frankly I'm a little surprised at how poor the installation documentation is
The only thing I can think of is I have the wrong version of Eclipse. Which exact one is everyone else using?
Hello Subjective Effect. There is not a folder named eclipse\jre\bin in eclipse installation folder. The version i m using is eclipse-helios. I was not faced the problem you have.
I've solved that part of the problem by downloading a different version of Eclipse. It is a Helios version and is the one with Java. The installation instructions are not clear on this.
I now have another issue but I'll try work that out for the time being.
So I've no idea (again because the instructions are so poor) what to do about this.
I'm on the Android Developers site and trying to start the Hello World tutorial. I'm already stumped at the stage of creating a New Project because after I set up Project name, Application name, Package name and Create Activity clicking "Finish" gives this error:
[2010-10-28 01:33:03 - HelloAndroid] ERROR: Unable to open class file C:\workspace\HelloAndroid\gen\com\subjectiveeffect\helloandroid\R.java: No such file or directory
The reason I think the docs are poor is am I supposed to have created this directory or does Eclipse create it for you? And if it's supposed to be created for you what am I doing wrong?
Subjective Effect said:
So I've no idea (again because the instructions are so poor) what to do about this.
I'm on the Android Developers site and trying to start the Hello World tutorial. I'm already stumped at the stage of creating a New Project because after I set up Project name, Application name, Package name and Create Activity clicking "Finish" gives this error:
[2010-10-28 01:33:03 - HelloAndroid] ERROR: Unable to open class file C:\workspace\HelloAndroid\gen\com\subjectiveeffect\helloandroid\R.java: No such file or directory
The reason I think the docs are poor is am I supposed to have created this directory or does Eclipse create it for you? And if it's supposed to be created for you what am I doing wrong?
Click to expand...
Click to collapse
Mine seems to have that error no matter what I type in.
So what have you done about it? Or can I continue without worrying, is this a trivial error message?
1) you should download Eclipse 3.5.2 as Helios is not supported by Android plugin yet.
http://www.eclipse.org/downloads/packages/eclipse-classic-352/galileosr2
2) R.java problem should go away if you restart eclipse
Also, to start with better use the existing sample project HelloWorld rather than setting up your own.
This is a common known bug. You can use the latest eclipse version, once you setup a project, you will have to go under project properties and choose compiler version 1.6, which is set to 1.5 usually.
Tha will solve the problem, because i was facing the same a few days ago when starting to mess with SDK and Eclipse.
I had a similar problem and gave up for awhile and when I came back to it I found out that I didn't have my paths set correctly for the java jdk, not sure if that is it but it worked for me.
I find if I restart Eclipse it fixes things.
I've been playing with layouts!

Wanted: Compile for Android ON THE DEVICE!

Way back when, I could run a c# compiler on my Windows Mobile phone and create apps. I think it would be fun to do on-device "compilation" on my Desire Z too.
I'm not asking for an IDE -- just something that can take Java source code and XML files, compile to bytecode for Dalvik and produce an .apk -- all on the device itself.
Is this possible?
OK -- we'd have to both a javac (java compiler) and a dx tool running on the device to do this. The first compiles the java source, the second takes that file and converts it to Dalvik bytecode.
Anyone else interested in this?
I'm very interested too. I tried sl4a but it's limited for now.
Sent from my Desire HD using XDA App
Dexify java compiler
I'm also very interested!
I develop in Java for the Eve VM on Windows Mobile: [www t-arn com/software.htm]
but for this I needed to install a JavaVM on the device.
But it should be possible to dexify the java compiler. I found following post:
[www ist-music eu/developer-zone/documentation/phoneme-and-osgi/music-on-android]
The porting of OSGi requires the dexification of the OSGi bundles. This is a process which makes any JAR file (compliant with Java VM) compatible with Dalvik VM. It basically consists on adding a new file, classes.dex, into the JAR file. To dexify each OSGi bundle, a two-step process is required by using the Android SDK tools. In windows, the process would be:
* Create the classes.dex file associated to the JAR file:
[ANDROID_SDK]\platforms\android-1.5\tools\dx.bat --dex --output=%CD%\classes.dex my_bundle.jar
* Incorporate the classes.dex file into the JAR file:
[ANDROID_SDK]\platforms\android-1.5\tools\aapt.exe add my_bundle.jar classes.dex
Now, the dexified bundles work on both VMs: Java VM and Dalvik VM.
Click to expand...
Click to collapse
I guess, we could do that for javac. If this does not work, we could try another Java compiler:
- EJC: [thecoderlounge blogspot com/2010/05/ecj-eclipse-java-compiler.html]
- kopisusu: [klomp org/KopiSusu/download.html]
I have no idea how to dexify the dx tool, though :-((
Hope to hear more from you guys
Tom
I have not yet gotten the Android SDK (nor a device...) but it seems that the dx tool itself is written in java. There is a dx.jar in the SKD. This one might already be dexified...or we could dexify with itself.
Tom
On-device development & compiler on a server...
Hi guys, I'm new to this Forum - just got my Archos 101 and now I'm searching for some more fun with it ;-)
So I really liked you guy's idea of having a compiler on the device itself - especially since the java compiler's really fast, so no doubt it can run on a smartphone...
I was really tempted by the open source "Open Blocks" library (education.mit.edu/openblocks) from some of these "Lifelong Kindergarden" people at the MIT... they're having this neat programming environment for teaching children programming, where you can drag/drop your source code like Lego...
Here you can have a look how the programming looks:
education.mit.edu/webdav/How%20to%20Create%20a%20Procedure/How_to_Create_a_Procedure.html
Now even google is using a similar thing, probably the same sources for their "App Inventor" (appinventor.googlelabs.com/about/), but you can only develop online at a real pc, then the .apk file is packaged on the server and downloaded to your android device...
So that's practically another way of having stuff compiled "on your device" - you could do the the development on a device and then have a server dedicated for a fast compiler and dx run...
Basically, I'd say that's the perfect system to write quick programs on a touchscreen device, especially when it's a bit larger tablet...
So if anyone wants to join in, I think I'm really keen on trying to port this OpenBlocks thing to the android screen ;-)
Cheers,
wowbag
Java IDE on Android
Hello everybody
I have just finished the latest version of taJavaIDE (0.3.0)
This APK is meant to become an Android development tool with which you can create native Android apps (APKs) ON the Android device itself.
What is working so far (on my Desire HD):
- Eclipse compiler for Java is integrated and working
- dx tool is integrated (not yet tested properly)
- BeanShell Interpreter is integrated and working.
You can write your own BeanShell script, store it on your SDCard and automate
the build process with it.
What is NOT yet working:
- aapt
- apkbuilder
- jarsigner
- zipalign
apkbuilder and jarsigner should not be a problem. I think, I can integrate those in the same way I integrated ecj.
As far as I know, zipalign is not absolutely needed (I might be wrong here, though).
My biggest problem is aapt which is not a Java application but a C++ application. To make it run on Android, you would need to port it to Java (looks like a REAL challenge!) or use the NDK to create a native library that you could then access from the APK.
I have no experience with the NDK and I also don't have the necessary build environment, so I would really appreciate if someone would help me out here!
Anybody interested in contributing?
Tom
Wow, thanks for getting this started, t-arn!
It's been forever since I did any C++, but I'll take a look at aapt and see what I can figure out.
Hopefully, a true C++ programmer will come along and set us straight
I'm very interested in this project and I would be willing to try to help out if you need it. I'm a second year software engineering student and I'm currently on a work term where all of my work is with android. I may not be of much help but at least I think I have some idea what I'm doing so let me know.
you are correct in saying that zipalign is not necessary. we only need it if we want to sign the apk in release mode(for publishing it to the market). We could just use debug mode and everything would be fine. I'm sure that if someone wanted to release an apk to the market, they could just copy the files over to their pc and zipalign it there. We would still be able to use the apk on the device without using zipalign.
t-arn said:
- jarsigner
Click to expand...
Click to collapse
Serison has an application on the market to sign APK's. Just thought I would let you know it is possible.
I would like this as well, as my phone has a physical keyboard and typing code isn't that bad on it - atleast not for minor edits/tweaks
JavaIDEdroid open source project
Hello everybody
I have created an open source project for JavaIDEdroid:
http://code.google.com/p/java-ide-droid/
Everybody is welcome to join the project (and hopefully contribute to it!)
As soon as I have cleaned up the code a little bit, I'll upload the source and the current APK.
For further questions and discussions, please join the java-ide-droid group. You'll find the link on the project's home page.
See you there!
Tom
Sounds pretty promising,looking forward to give it a try!
Sent from my Dell Streak using XDA App
Sounds possible, if you have the right components. I would love this. Would definitely donate to whoever got it working easily and 100%.
Very interesting project
Look nice. Downloading now.
I have wanted this since I first got an android phone.
I ended up using a virtual debain command line running OpenJava to compile and run the stuff. But if i can do it without that hastle in one app, I will LOVE you.
Edit: I tried it out. Mind explaining how to make a beanShell script? on the ECJ it always gives me a security exception even with just -help.
Code:
java.lang.SecurityException
at java.lang.System.setSecurityManager(System.java:610)
at com.t_arn.JavaIDEdroid,.DE.fnCompile(IDE.java:44)
at com.t_arn.JavaIDEdroid.MainActivity.fnCompile(MainActivty.java:167)
at com.t_arn.JavaIDEdroid.MainActivity.tabCompile_btnCompile(MainActivity.java:137)
......
Done in 1305348377 sec.
Please join the JavaIDEdroid support group at http://groups.google.com/group/java-ide-droid and re-post your question there.
I'd like to keep discussions there.
Thanks
Tom
very interesting, ill join the group, i can make the native lib for the aapt.
I would say get gcc working on the device then you can compile anything. You can compile a javavm. A native binary. Etc. If gcc can be compiled and work then all programs most likely can be compiled on the device assuming the proper libs are there to compile against.
Sent from my Incredible using Tapatalk

Eclipse 4.2.2

To get started, I installed the Android SDK with ADT that also came with eclipse (unknown to me it came with eclipse) after I installed the Eclipse for JAVA developers. Neither one works as it says it can't locate the JAVAW file under jre/bin that's suppose to be in the eclipse folder. Anyhow, to see if I could fix it I cut the JRE folder from my Java folder, and placed it in the eclipse folder. It attempted to run this time but gave me an error saying it couldn't open the jvm.dll file. I then went back after watching the xdatv video and installed the eclipse classic. Still a no go. I also realized I have no JDK installed, which I'm doing so now, but either or I thought it would run with a JRE too.
Anyone got a fix for my issue? Or will installing the JDK be the fix?
Ok sorry for the stupid question. turns out I did install the jdk but a re-install fixed my issue.
Well, it's not really directly related with the problem you had, but next time you need to download the Android SDK, there is an option not to include the Eclipse in the bundle.
Are you setting up a build environment ? The reason I ask is there are a few easy ways to set it, using a more painless way.
dirtydroidx said:
Are you setting up a build environment ? The reason I ask is there are a few easy ways to set it, using a more painless way.
Click to expand...
Click to collapse
I am. The problem was resolved, and able to start eclipse with no problem now.

Can't get Android Studio to work - Gradle issue

Hello XDA.
I have used Eclipse, and wanted to try out Android Studio.
The problem is, when creating a new project, i get a "Resolve Error":
Failed to import Gradle project: Could not create an instance of Tooling API implementation using the specified Gradle distribution 'h**p://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Could not determine implementation class for service 'org.gradle.tooling.internal.protocol.ConnectionVersion4' specified in resource 'jar:file:/C:/Users/Me/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6/lib/gradle-launcher-1.6.jar!/META-INF/services/org.gradle.tooling.internal.protocol.ConnectionVersion4'.
C:\Users (Access is denied)
Consult IDE log for more details (Help | Show Log)
Click to expand...
Click to collapse
Seems like noone else got this problem.
I run as Administrator.
Why XDA, WHY?
Are you really creating totally new, empty project? That error message sound more like your gradle has problems importing an existing gradle project.
I'm running into the same issue, and yes, when creating a totally new project this error raises... Even though, after pressing ok, it continues loading (linux version)...
Sent from my LG-P350 using xda app-developers app
Broke'n'Droid said:
Are you really creating totally new, empty project? That error message sound more like your gradle has problems importing an existing gradle project.
Click to expand...
Click to collapse
Yes, like dbarrera said.
This is Windows version.
Any idea?
Have you tried updating your SDK and have you checked your gradle.build in root folder for any errors?
Sent from my SAMSUNG-SGH-I747 using xda premium
ansfent had
tepews said:
Hello XDA.
I have used Eclipse, and wanted to try out Android Studio.
The problem is, when creating a new project, i get a "Resolve Error":
Seems like noone else got this problem.
I run as Administrator.
Why XDA, WHY?
Click to expand...
Click to collapse
I ran into all sorts of trouble trying to set up Android Studio on my Windows 7 64 bit machine: Missing environment variables, mismatching JRE/Android SDK versions, Gradle compatibility issues, etc., etc. After serveral failed attempts, I finally gave up and went back to my old reliable ADT/Eclipse IDE. I don't want to sound pessimist, but I would give it a little more time.
hey Guy's...
if you have problems with gradle try to download the gradle-1.6-bin.zip from http://services.gradle.org/distributions/gradle-1.6-bin.zip and then copy it to the *\Android\android-studio\lib* directory.
"
Download Gradle from its distribution page at http://services.gradle.org/distributions/gradle-1.6-bin.zip
Then you should copy all the contents of gradle-1.6 to \Android\android-studio\plugins\gradle directory
You should also copy the gradle.jar file to \Android\android-studio\lib\ directory"
Finally you should restart Android Studio. After restart everything should work fine.
let me know if it work`s :silly:
It`s Weekend... :highfive:
I have a lot of problems with Android Studio, so I will work with Eclipse until Google fixes all bugs.
still not working...
dude1986 said:
hey Guy's...
if you have problems with gradle try to download the gradle-1.6-bin.zip from and then copy it to the *\Android\android-studio\lib* directory.
"
Download Gradle from its distribution page at
Then you should copy all the contents of gradle-1.6 to \Android\android-studio\plugins\gradle directory
You should also copy the gradle.jar file to \Android\android-studio\lib\ directory"
let me know if it work`s :silly:
It`s Weekend... :highfive:
Click to expand...
Click to collapse
I've tried this process, but it's not working...
Everytime I try to start a new project, I receive a message:
org.jetbrains.plugins.gradle.settings.GradleSettings cannot be cast to org.jetbrains.plugins.gradle.settings.GradleSettings
Do you know what could be causing this?
Thanks in advance.:good:
Finally you should restart Android Studio. After restart everything should work fine.
Hi,
If anyone has trouble with Android Studio, try to install it not in C:// (for Windows), but in another partition. I use it, and it always worked. And also, Android Studio usually will download Gradle by itself automatically.
If the problem still persist, try to re-install (re-download the newest version if necessary). Based on my tips above.

Categories

Resources