I bought an app created with Cordova. I create a signed apk in Android Studio but when I try to publish the app in the Play Market I get an error:"Your application must have a valid targetSdkVersion set. To solve this problem, you need to edit your AndroidManifest.xml file and upload again the .apk file."
My config.xml:
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="29" />
My Manifest:
<uses-sdk
android:targetSdkVersion="29"
tools:ignore="GradleOverrides" />
paste this in your manifest file
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="29"/>
Related
Good day,
I have a cordova mobile project, and I using "cordova platform add android" command to add my android platform.
In my config.xml, I set the minSdkVersion to 26 as follow:
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:allowBackup="false" />
<application android:networkSecurityConfig="#xml/network_security_config" />
<uses-sdk android:minSdkVersion="26" />
</edit-config>
When I run "cordova platform add android" command, the "/platforms/android" folder and its files will be removed and auto generated. after it auto generate, I check the cdv-gradle-config.json file under "platforms/android", and found the "MIN_SDK_VERSION": 22.
May I know where is this "22" come from? or any mistaken I did to cause this issue?
My cordova version is 10.0.0 (cordova-lib#10.1.0).
My gradle version is 4.7.
Set this code in config.xml
<preference name="android-minSdkVersion" value="22" />
<preference name="android-targetSdkVersion" value="31" />
This is the only tip that works.
I have a PhoneGap app which installs good on any version on Android using the APK.
But upon hosting on PlayStore as Internal Test, it doesn't allow it to be installed on device Android 8 or lower.
The error prompted is "The device is not compatible with this version"
On some other device not listed in Playstore, it just says Item Not Found.
I have choose all countries to host the app.
Following is the config file extract
<preference name="android-minSdkVersion" value="23" />
<preference name="android-maxSdkVersion" value="28" />
<preference name="android-targetSdkVersion" value="28" />
Please advice where I should I be looking into - Play store console or my app?
Though not entirely sure where the problem was, but following config does work
<preference name="android-minSdkVersion" value="23" />
<preference name="android-maxSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="28" />
<preference name="android-build-tool" value="gradle" />
Set above in your config.xml file of your root folder.
So, I have an Ionic app which I need to upgrade to target API Level 28 to conform to the new Playstore regulations. I'm using this in my config.xml:
<preference name="android-targetSdkVersion" value="28" />
The problem is that with this update, the app crashes everytime I use the BackgroundGeolocation plugin. I found out that I should use this code in my config.xml file, but it didn't changed anything:
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/uses-permission" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</edit-config>
Is there any way to do this update without upgrading to Ionic 4?
I have a simple, but useful app for an old android device I want to develop with Cordova PhoneGap. Going through their tutorial, by default, the current version of cordova requires android level 14 api to build apps, but I've done the following to get the app to build on my old 2.3.6 device...
In /config.xml add the following in the platform->android tag
<platform name="android">
<allow-intent href="market:*" />
<preference name="android-minSdkVersion" value="10" />
<preference name="android-targetSdkVersion" value="10" />
</platform
Edit these lines in the /platforms/android/AndroidManifest.xml file
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="fi.blogspot.codinginthecold" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" tools:overrideLibrary="org.apache.cordova" />
Like I said, the HelloWorld app compiles on the device without error, but when I actually run the app, it says the app has unfortunately stopped.
My question: As the above method failed to run the simplest app, what is best way to develop PhoneGap apps for old android devices?
Thanks.
I am creating an application using Cordova. In the platforms folder there is an AndroidManifest.xml file where we can specify the version and other things. But whenever I run the app using cordova run android it reinitializes the file and makes it to the previous state as it was before editing and specifying version name.
Does anyone knows how to stop replacing that file while running that command?
Try specifying the sdk versions in your config.xml, as it is the source for generating the AndroidManifest. Your can add the sdk versions in your config.xml like this:
<preference name="android-maxSdkVersion" value="23" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="20" />