Skip to content

A curated list of commonly faced issues and error messages and how to solve them. The list is still in development mode.

License

Notifications You must be signed in to change notification settings

Rahul2pancholi/Commonly-Faced-Android-Errors

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Commonly-Faced-Android-Errors

A curated list of commonly faced issues and error messages and how to solve them. The list is specifically designed for Android Basics Course on Udacity as a part of Google Challenge India Scholarship, though most errors are general in nature and can occur while developing for any application.

1. Cannot Resolve Symbol (-R) or R.layout.main Cannot Be Found

Sometimes Android Studio is unable to generate R.java file correctly. R.java is a dynamically generated class, created during build process to dynamically identify all assets (from strings to android widgets to layouts), for usage in our java classes.

Solution :-

The most optimum solution is to Clean Build the Project and Sync again. Build > Clean Project would normally resolove this issue. Also check for the import statements and see if the package name is correct. If there is some modifications in directories and files you would do File > Invalidate Caches / Restart > Invalidate and Restart .

2. Getting MainActivity.kt instead of MainActivity.java

.kt is for Kotlin file extension. This is not an error but if you are following the Android Basics Course code, it will generate errors. The Course follows Java programming language, instead of Kotlin. This appears when you check Include Kotlin option in the begining of your Project Creation.

Solution :-

It is recommended that to close this project and create a new one. Refractoring MainActivity.kt to MainActivity.java might do the trick, but you need to change every Java file thereafter. Since Kotlin is 100% interoperable with Java, you can incorporate it seamlessly into your existing app. So if you are following this course, create a new project.

3. What is Gradle? Does Gradle == Error?

Gradle can be bit confusing for a new Android developer. Sometimes people make it synonymous to error.

Solution :-

tl;dr : Gradle is a system to build Android Applications.

Read on:- Gradle is a build system and is improvised form of other build systems. It is based on JVM. You must have seen build.gradle file(s) in your project. That is where you can write scripts to automate your tasks. The code you saw in these files is Groovy code. If you write System.out.println("Hello Gradle!"); then it will print on your console. Gradle doesn't correspond to errors. Read more at https://stackoverflow.com/questions/16754643/what-is-gradle-in-android-studio

4. Error:CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher

Solution :-

Install JDK 1.8. Then in Android Studio navigate to File-> Project Structure-> SDK Location, select your directory where the JDK is located.Click OK and you are good to go.

About

A curated list of commonly faced issues and error messages and how to solve them. The list is still in development mode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published