Juny
Juny

Reputation: 299

Android Studio CordovaAndroidVersion

I'm trying to generate a signed Apk with ionic capacitor, to and old app. According to ionic info, this is the project configuration:

Ionic:

Ionic CLI                     : 6.17.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework               : @ionic/angular 5.9.4
@angular-devkit/build-angular : 0.1102.19
@angular-devkit/schematics    : 11.2.19
@angular/cli                  : 11.1.4
@ionic/angular-toolkit        : 3.1.1

Capacitor:

Capacitor CLI      : 2.4.6
@capacitor/android : 2.5.0
@capacitor/core    : 2.5.0
@capacitor/ios     : not installed

Utility:

cordova-res : 0.15.4
native-run  : not installed globally

So I'm using ionic with capacitor, and I have some cordova plugins for example: "@awesome-cordova-plugins/barcode-scanner": "^5.39.1" "@awesome-cordova-plugins/in-app-browser": "^5.0.0"

And now when i try to generate the signed apk, i have a lot of erros, already fixed some like removing the jcenter and others.

Then i faced another error:

Execution failed for task ':app:collectReleaseDependencies'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
 > Could not find framework-7.0.0.aar (org.apache.cordova:framework:7.0.0).
  Searched in the following locations:
     https://jcenter.bintray.com/org/apache/cordova/framework/7.0.0/framework-7.0.0.aar
     https://jcenter.bintray.com/org/apache/cordova/framework/7.0.0/framework-7.0.0.jar

And searching I found that need to update the cordovaAndroidVersion from 7.0.0 (current version) to 10.1.1.

So updated and when try to generated the app:

error: incompatible types: Activity cannot be converted to AppCompatActivity
super(activity, Executors.newCachedThreadPool());

Any tips? How to solve those problems?

Saw that a dev resolve this with:

yarn cap migrate

But I'm not using yarn and the command npx cap migrate doesn't exists.

Upvotes: -1

Views: 23

Answers (1)

Juny
Juny

Reputation: 299

The problem was that I was using a outdated capacitor version, after upgrade to capacitor 3, it worked!

Upvotes: 0

Related Questions