Getting "class file for androidx.appcompat.app.AppCompatActivity not found" while building
See original GitHub issueI’m getting an error while building the app in Android Studio:
.../node_modules/capacitor-fcm/android/capacitor-fcm/src/main/java/io/stewan/capacitor/fcm/FCMPlugin.java:96: error: cannot access AppCompatActivity
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(getActivity(), new OnSuccessListener<InstanceIdResult>() {
^
class file for androidx.appcompat.app.AppCompatActivity not found
I’m using @capacitor/core v 2.0.0 and @capacitor/android v 2.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
class file for androidx.appcompat.app.AppCompatActivity not ...
My current work around is to add implementation "androidx. appcompat:appcompat:1.2. 0" into the build. gradle dependencies block for the plugin ...
Read more >android - can't resolve AppCompatActivity - Stack Overflow
Solution : Go to your build.gradle file and in your dependencies find the appcompat one, something like compile 'com.android.support:appcompat-v7:XX.X.X'.
Read more >Different Ways to fix Cannot resolve symbol ... - GeeksforGeeks
Go to your build.gradle(Module:app) file and in the dependencies section the appcompat one, you should see something like compile 'com.android.
Read more >class file for androidx.appcompat.app ... - CodeRanch
AppCompatActivity not found "? The class is being called from inside an aar library file. The class which extends the AppCompatActivity class does...
Read more >AppCompatActivity - Android Developers
This method is called whenever the user chooses to navigate Up within your application's activity hierarchy from the action bar. @Nullable ActionMode.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW I’ve just faced the same issue
to fix it add this to your app gradle.properties
clean project + rebuild in Android Studio
Removing and adding Android platform has solved the issue. Thanks