Closed aravindsnkr2 closed 3 years ago
@aravindsnkr2 Check this working example with a capacitor. https://github.com/ClickerVinod/Ionic4AutoOTPVerify
I'm having the same error, the gradle file looks similar to the working example
https://capacitorjs.com/docs/android/troubleshooting
Error: “package android.support.* does not exist” This error occurs when some Cordova or Capacitor plugin has old android support dependencies instead of using the new AndroidX equivalent. You should report the issue in the plugin repository so the maintainers can update the plugin to use AndroidX dependencies.
As a workaround, you can also patch the plugin using jetifier:
npm install jetifier npx jetify npx cap sync android
You should rather install this plugin : cordova-androidx-build
to make it build without error
I was using this plugin in our Ionic 3 app and it was working. We decided to migrate to capacitor from cordova and after migration the build fails if this plugin is installed.
Here is the error output Android Studio shows :
/Users/username/android-app/android/capacitor-cordova-android-plugins/src/main/java/com/codingsans/ionic/smsRetriever/AndroidSmsRetriever.java:14: error: package android.support.annotation does not exist import android.support.annotation.NonNull; ^ /Users/username/android-app/android/capacitor-cordova-android-plugins/src/main/java/com/codingsans/ionic/smsRetriever/AndroidSmsRetriever.java:161: error: cannot find symbol public void onFailure(@NonNull Exception e) { ^ symbol: class NonNull
We are planning to migrate to Ionic 4 and then to 5 if the capacitor migration is successful.