6

After importing an Eclipse ADT project into Android Studio, I'm seeing these errors:

Error:(28, 34) error: package android.support.annotation does not exist

Error:(34, 34) error: package android.support.v4.content does not exist

Error:(26, 30) error: package android.support.v4.app does not exist

I have installed the Android Support Library and Repository through SDK Manager, and here's my dependencies in the build.grade file for the module:

compile project(':pullToRefreshListView')
compile project(':facebook')
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile files('libs/google-play-services.jar')

Not sure why it doesn't see the Android support library.

Ehsan
  • 63
  • 1
  • 1
  • 6
  • try to clean Project , Rebuilt project and try – sushildlh Apr 28 '16 at 05:39
  • Did a clean and rebuild, still seeing the same error – Ehsan Apr 28 '16 at 05:49
  • @Ehsan Did you tried the fix of question http://stackoverflow.com/questions/36833606/android-support-library-error-after-updating-to-23-3-0? It is not the same issue but may help you – guipivoto Apr 28 '16 at 14:34
  • Solution (Gradle) - http://stackoverflow.com/questions/16690914/importing-notnull-or-nullable-and-android-studio-wont-compile – Inoy Dec 06 '16 at 23:35

1 Answers1

5

My result is not so qualified but it works for my project.

When i look an old project, i had that problem at facebook module which was added in my project. (That problem is not about facebook.)

There is a jar file called android-support-annotations.jar.

This jar file is in sdk_direction/extras/android/support/annotations/ path.

As first, I took it and i added it in that module's libs folder under my project.

Then i added below line in that module's build.gradle file;

compile fileTree(dir: 'libs', include: ['*.jar'])

As last, i synced the project and that problem has been resolved.

useful ref : Missing annotations.jar

This error also can occur while porting or accidental removal of dependencies: reference link

Community
  • 1
  • 1
oguzhan
  • 2,073
  • 1
  • 26
  • 23