Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning Android API level 28 with ionic-v3 and cordova 6.3.0

I used to publish an ionic app on google play but this morning I had the following warning: "Your application targets now level API 26. Nevertheless, it should now target level API 28 ..."

I'm using Cordova 6.3.0, how can I target API 28 with it?

Here is my ionic info :

Ionic:

   ionic (Ionic CLI)  : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   cordova (Cordova CLI) : 9.0.0 ([email protected])
   Cordova Platforms     : android 6.3.0, ios 5.0.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 14 other plugins)

System:

   NodeJS : v10.16.0 (/usr/local/bin/node)
   npm    : 6.9.0
   OS     : macOS Mojave
   Xcode  : Xcode 10.2.1 Build version

I have no error message when building my app locally like I did until now, the warning is only on google play platform.

Here are the command line I generally use :

npm i
cordova platform rm android
ionic cordova platform add [email protected] --save-exact

ionic cordova build android --prod --release

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore somekeystorye.keystore /Users/user/Documents/dev/app/platforms/android/build/outputs/apk/android-release-unsigned.apk Name

~/Library/Android/sdk/build-tools/29.0.1/zipalign -v 4 /Users/user/Documents/dev/app/platforms/android/build/outputs/apk/android-release-unsigned.apk /Users/user/Documents/dev/app/platforms/android/build/outputs/apk/android-release-0.0.20.apk

Any idea?

EDIT Is seems that :

<preference name="android-targetSdkVersion" value="28" />

Does the job as mentioned here : Can cordova [email protected] target SDK 26? I have no warnings now.

Will try to check and come back later to keep you in touch

like image 341
axx Avatar asked Jul 12 '19 13:07

axx


People also ask

What is Cordova Android?

Cordova Android is an Android application library that allows for Cordova-based projects to be built for the Android Platform. Cordova based applications are, at the core, applications written with web technology: HTML, CSS and JavaScript. Apache Cordova is a project of The Apache Software Foundation (ASF).


2 Answers

After spend some time on this error i found this three solution.

solution 1

ionic cordova platform rm android

ionic cordova platform add [email protected]

solution 2

<preference name="android-targetSdkVersion" value="28" />

solution 3 (if above solution not work then only)

  1. Follow this step
    1. Update Your sdk to api level 28 from android studio.
    2. Create new project with "ionic start".
    3. Copy paste your old code to this new created project and install your all plugin and it's Done!
like image 133
kunal shaktawat Avatar answered Oct 10 '22 01:10

kunal shaktawat


for me what works finaly was just this :

<preference name="android-targetSdkVersion" value="28" />

like image 29
axx Avatar answered Oct 10 '22 02:10

axx