Many Android developers must have faced errors while Android Studio IDE Installation for android application development. In my previous blog I talked about Android Studio Genymotion Installation. Today I am going to discuss couple of Android Studio installations errors which I faced on Ubuntu system and hacks I used for resolution. This will be useful for beginner android developers.
Android Studio IDE Installation Hack No 1
Error :: Could Not Determine Java Version
Reason For this Error
Above error occurs when your path of JDK(Java Development Kit) is not set to the latest version of JDK which is installed in your system.
Because of this error you cannot run your project or do android application development. Error occurs because Android Studio is not able to find the correct java version. When you try to run the app its says:
“Error running app. Gradle running sync failed. Please fix your project and try again.“
How to Resolve this Error
- Open Android Studio IDE.
- Click on File (left top corner).
- Select Project Structure.
- You can see the SDK (Software Development kit) location, JDK(Java Development kit) location and NDK (Native Development Kit) location.
- Click on Browse icon of JDK location.
- There you can see all the JDK Version which is installed in your system.
- Now click on the latest JDK version which is installed in your machine(In my case it is Java 1.7.0) .
- Now click OK.
- After that close your Android Studio IDE and restart.
- Congratulations! The error will go away. You can now run your android app or project without any hiccup.
Android Studio Installation Hack No 2
Error :: Resource id Cannot be an Empty String
I faced this error when I installed android studio IDE for the first time and launched it with MyFirstApp. It runs perfectly for the first time. After that I closed Android Studio and restarted after some time. This time I faced below error:
Resource id cannot be an empty string(at ‘id’ with value ‘@+id/’)
How to Resolve this Error
- This error is in Activity_main.xml file.
- So open Activity_main.xml (click on MyFirstApp -> App -> src -> main -> res -> layout -> Activity_main.xml) file.
- Just copy the “RelativeLayout” and paste it where you see this error. Exactly like this “android:id=”@+id/RelativeLayout”.
- Your error will go away. Sweet!
Hoping above solutions will be helpful and save lot of your time. You can get started with below android tutorials for beginners and kickstart your android application development.
Below are more advanced android programming tutorials:
Thank you for reading this article. If you face any problem or having any doubts regarding android development, just let me know in comment box. If you like my article please like our Facebook page and also follow on Twitter. By doing so you will get regular updates about Android tutorials. For regular updates you can also subscribe to hackpundit.com with your email.