简体   繁体   中英

Ionic application targets API level 25 and must target at least API level 26

I am creating an android application using ionic 3, when i attempt to upload to playstore i get an error that my app targets api 25, when i check my project.property the value of target =android-26, same with my androidManifest.xml the value of targetSdkVersion = 26, how do i set the target again. Below is my ionic info

Ionic:

ionic (Ionic CLI) : 4.4.0 (C:\\Users\\IETECH\\AppData\\Roaming\\npm\\node_modules\\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.8

Cordova:

cordova (Cordova CLI) : not installed Cordova Platforms : not available Cordova Plugins : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 8 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\\Program Files (x86)\\Android\\android-sdk) NodeJS : v8.12.0 (C:\\Program Files\\nodejs\\node.exe) npm : 6.4.1 OS : Windows 10

Did you build using a specific android version? What versions have you installed to Android Studio? Maybe you built using a version provided automatically and somewhere in your config you had another version specified. Anyway cant answer with that information. When you build the app you get no errors?

You need to install android platform 26, and then change android:targetSdkVersion="26" in the <uses-sdk> tag in platforms/android/AndroidManifest.xml file in the Ionic 3 application folder.

You should then be able to create a new release build and upload the app to Play Store successfully.

Alternatively, if you upgrade cordova to the latest version, a fresh cordova build will create the AndroidManifest.xml file with android:targetSdkVersion="26" .

Open your config.xml in the root folder of the project and adjust version accordingly in the following section:

<platform name="android">
        <preference name="android-minSdkVersion" value="25" />
...

Basically update the value to what your min bar is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM