This article is for all the beginners who have just started Android development Tools on Eclipse IDE for developing the android applications. Most of the beginners often face errors while developing the android applications.
The errors which I am going to discuss in this article are not syntax errors. These errors occur automatically (in most cases) and sometimes because of user’s mistake.The article deals with the errors, probable cause of the errors and their possible solutions.
My Environment is:
- Android Developer Tools, Build: v22.3.0-887826
- IDE: Eclipse Platform
ERROR #1: Eclipse IDE does not start
In windows 10 operating system, it is seen for some users that the eclipse IDE does not start even after double clicking the eclipse icon.
You may have tried :
- Reinstalling the Eclipse IDE,
- Restarting the PC
- Reinstalling the JDK.
Corruption of the eclipse. ini file due to change in the version of the jdk, or due to multiple installations of eclipse.
- Go to the folder where your Eclipse IDE is stored
- Open the ini file with a suitable text editor like notepad++
- Make sure the file content looks similar to the image given below
- Especially check for the order of the highlighted lines in which they appear
- Save the changes
- Restart the IDE. Now it should work
ERROR #2: Missing R.java file
The R.java file which is automatically generated whenever a new project is created, If it is not being created,it leads to many errors when we try to access any resource item
You may have tried:
- Cleaning the project
- Rebuilding the project
- Refreshing the project
Bad resources (e.g. layouts with errors)
- Expand the res folder
- There may be some folders/files which may have red mark beside them
- Delete them
- The R.java file will regenerate
- If you have R.java file in some other project, simply copy it and paste it into the gen folder
- Refresh the Project
ERROR #3: App has stopped working unexpectedly
This error occurs when the app is deployed on to the emulator or the android phone. This error cannot be detected at the time of compilation.
Activity file missing
- Go to the android.manifest xml file highlighted below
- Check whether all the activities that are being used in the program are defined in the Manifest file inside the <application> tag
- Build/Refresh the project
- Run the app
ERROR #4: Android.Manifest file does not declare a Java package
The following is the error message that might be getting displayed:
[2015-10-25 10:43:19 – com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read /media/DATA/code/Android/XXX/AndroidManifest.xml: org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: ‘/XXX/AndroidManifest.xml’.
This error occurs when user edits a workbench resource outside of Eclipse.
There are generally two common approaches that are followed and have found to be useful for resolving errors for most of the users.
|| If method I does not work, then try to “Clean” the project.
Steps for cleaning Project:
- From the menu bar, select “Project” and then select the “Clean…” item.
- Make sure that you check the current project to clean
ERROR #6 : Emulator does not start
- Emulator not configured Properly
- Not enough RAM available
- Make sure RAM value is not greater than 768 Mb. Optimum value to be chosen is 512 Mb
- You can mark the Host GPU checkbox for faster boot of the emulator
- Click Ok
- Try running the emulator
- Use Genymotion emulator as it is way faster than Android stock emulator
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Article By Mudit Maheshwari:
A 3rd year B.Tech IT student from VIT University, Vellore having keen interest in coding, learning about new technology and developing softwares. Besides being passionate about coding, he also loves playing guitar and singing. Currently staying in Chennai. You can reach him at email@example.com.
If you also wish to showcase your blog here, please see GBlog for guest blog writing on GeeksforGeeks.
- Android App Development Fundamentals for Beginners
- Top Programming Languages for Android App Development
- Why Kotlin will replace Java for Android App Development
- App Development for Android in 2017: Challenges and Solutions
- Android & iOS App development using React Native with Expo
- Top Android Development Frameworks to Learn in 2019
- Android | How to Create/Start a New Project in Android Studio?
- Android | How to add Radio Buttons in an Android Application?
- Android | Android Application File Structure
- Android | AdMob Interstitial Ads for Android Studio
- Android | AdMob Banner Ads for Android Studio
- Android | How to Request permissions in Android Application?
- How to setup Proxychains in Linux without any Errors?
- Android | Running your first Android app
- What is full stack development ?