Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Codeprojecters,

today i've started to learn to program in Java for Android.

I have used Android-Studio to generate the initial code. But if i'm opening my MainActivity.java i have seen that it uses a "import android.support.v7.app.AppCompatActivity;" for including AppCompatActivity as dependency. The IDE tells me that it can't resolve the symbol "AppCompatActivity".

The build.gradle for the app module contains:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}

Also the Library is present inside <sdk>/extras/android/support with version 22.2.1.

But i'm wonder why it doesn't find it.

Maybe anyone knows more?

Greetings
Sascha
Posted

1 solution

Most likely you have set the application level higher than the libraries you have installed with Android Studio. Unfortunately, Android development seems to move quite fast so you need to ensure you have the latest libraries, and that you set your target level for the version you can support. You can get more information at http://developer.android.com/tools/studio/index.html[^], and from Peter Leow's article: Setting Up Your Android Development Environment[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900