A little addition to other answers here, for anyone having the same error while using the right lib version and the right class.
When I upgraded to
appcompat-v7:22.1.0
In which ActionBarActivity
is deprecated and empty and AppCompatActivty
is the way to go, due to some glitch in Android Studio, It didn’t quite pick up on version change.
i.e. Even though Gradle ran without errors, the IDE itself kept saying Cannot resolve symbol 'AppCompatActivity'
(and it also wasn’t available through the Ctrl+N
search)
I looked into the .idea/libraries
folder and noticed there’s no appropriate metafile for the new version of the lib.
So, using the old-reliable File->Invalidate Caches/Restart did the trick. Always try this when you feel something is magically wrong with Android Studio. And then Disable offline mode and sync.
Related Posts:
- Cannot resolve symbol ‘AppCompatActivity’
- Android Studio Run/Debug configuration error: Module not specified
- No matching client found for package name (Google Analytics) – multiple productFlavors & buildTypes
- Execution failed for task ‘:app:compileDebugJavaWithJavac’ Android Studio 3.1 Update
- Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat
- “Gradle Version 2.10 is required.” Error
- Cannot resolve symbol AppCompatActivity – Support v7 libraries aren’t recognized?
- “unable to locate adb” using Android Studio [duplicate]
- “unable to locate adb” using Android Studio [duplicate]
- Enable VT-x in your BIOS security settings (refer to documentation for your computer)
- “Default Activity Not Found” on Android Studio upgrade
- Still getting warning : Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’
- ERROR Android emulator gets killed
- Change project name on Android Studio
- Execution failed for task ‘:app:processDebugResources’ even with latest build tools
- Set adb vendor keys
- how to overcome Android Studio cannot resolve symbol for android classes
- How to recompile with -Xlint:deprecation
- Execution failed app:processDebugResources Android Studio
- Session ‘app’: Error Installing APK
- “Failed to install the following Android SDK packages as some licences have not been accepted” error
- A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
- Why is Android Studio reporting “URI is not registered”?
- Android Studio: Unable to obtain result of ‘adb version’
- No tests found for given includes Error, when running Parameterized Unit test in Android Studio
- Getting error “The package appears to be corrupt” while installing apk file
- Execution Failed for task :app:compileDebugJavaWithJavac in Android Studio
- “cannot resolve symbol R” in Android Studio
- Could not find com.android.tools.build:gradle:3.0.1
- Could not find com.android.tools.build:gradle:3.0.1
- Error getGoogleAppId failed with status: 10 Android KitKat – GCM and Google Drive
- PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT (in windows 10)
- Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’
- What does “Failure [INSTALL_FAILED_OLDER_SDK]” mean in Android Studio?
- Why emulator is very slow in Android Studio?
- Android Studio SDK location
- Android Studio SDK location
- Android Studio-No Module
- Application Installation Failed in Android Studio
- Android Studio 1.2.1.1 – Failed to find style ‘textViewStyle’
- First run of Android Studio. Unable to access Android SDK add-on list
- Why AVD Manager options are not showing in Android Studio
- Android Studio: “Execution failed for task ‘:app:mergeDebugResources’” if project is created on drive C:
- Does anyone know the what’s causing “Package name is not a valid package name” when adding a new layout?
- Android Studio doesn’t see device
- “Field can be converted to a local variable” message appearing when setting Android ActionBar colour
- How to completely uninstall Android Studio from windows(v10)?
- How to clear gradle cache?
- Gradle error: Write access is allowed from event dispatch thread only in Android Studio
- DELETE_FAILED_INTERNAL_ERROR Error while Installing APK
- Android Studio : Failed to set EGL_SWAP_BEHAVIOR on surface
- Android SDK location should not contain whitespace, as this cause problems with NDK tools
- Unsupported major.minor version 52.0 when rendering in Android Studioandroid android-studio rendering preview
- ‘dependencies’ cannot be applied to ‘(groovy.lang.Closure)’
- Expiring Daemon because JVM heap space is exhausted
- Android Studio – Company Domain Name
- How to add a jar in External Libraries in Android Studio?
- Remove Project from Android Studio
- Android SDK path not specified
- How to solve failed to find build tools revision 26.0.2?
- Why is the Android emulator screen blank?
- How do I “select Android SDK” in Android Studio?
- Change the project theme in Android Studio?
- How to disable Instant Run for Android Studio 3.0
- Android Studio – Emulator – eglSurfaceAttrib not implemented
- Re-enable “component tree” in Android Studio
- How to determine the version of Gradle?
- Android studio- “SDK tools directory is missing”
- Android Studio – ADB Error – “…device unauthorized. Please check the confirmation dialog on your device.”
- HAX kernel module is not installed
- Failed to find style ‘coordinatorLayoutStyle’ in current theme
- SDK Location not found in android studio
- SDK Location not found in android studio
- Install an apk file from command prompt?
- Unity remote 5 not working
- recyclerview No adapter attached; skipping layout
- How to install APK from PC?
- Error “File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it”
- Facebook login NullPointerException
- How to use ScrollView in Android?
- What is com.google.android.gms.persistent and why is it always using the CPU?
- How do we use runOnUiThread in Android?
- How to add .gif Animation in unity Scene ? Does Unity support Animated GIFS?
- How to get current time and date in Android
- Gradle DSL method not found: ‘compile()’
- how to use getSharedPreferences in android
- Set transparent background of an imageview on Android
- Play sound on button click android
- android edittext onchange listener
- E/AndroidRuntime﹕ FATAL EXCEPTION: main
- Determining translationX/Y values for ObjectAnimator; how to move a view to an exact screen position?
- React Native: JAVA_HOME is not set and no ‘java’ command could be found in your PATH
- Android getText from EditText field
- Error: Could not automatically detect an ADB binary. Some emulator functionality will not work until a custom path to ADB is added in the extended…
- Manifest Merger failed with multiple errors in Android Studio
- hardcoded string “row three”, should use @string resource
- E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7519c0
- How to handle .tar.md5 files
- Why am I getting Permission Denied when trying to push a Sqlite file to my rooted Android device?
- Scrollview can host only one direct child