Reputation: 159
I am using sms-retriver for getting app hash string and I'm getting an error
package android.support.annotation does not exist
And I resolved this error by changing
import android.support.annotation.NonNull;
above code to the below code
import androidx.annotation.NonNull;
The change is happening in the file path
android\capacitor-cordova-android-plugins\src\main\java\com\codingsans\ionic\smsRetriever\AndroidSmsRetriever.java
This file is not able to push into repository and getting the same error in the ionic hub.
Upvotes: 3
Views: 7907
Reputation: 1361
ionic cordova plugin add cordova-plugin-androidx
ionic cordova plugin add cordova-plugin-androidx-adapter
this may help you.
Upvotes: 3
Reputation: 53301
That happens when a cordova plugin uses the old android support libraries instead of the new AndroidX support libraries. Capacitor uses AndroidX and you can't use non AndroidX libraries. You can use jettifier to patch the plugins
npm install jetifier
npx jetify
npx cap sync android
https://capacitorjs.com/docs/v3/android/troubleshooting#error-package-androidsupport-does-not-exist
Upvotes: 11