question

victorespina avatar image
victorespina asked victorespina commented

Getting error "Devices: Flex[21] do not meet minSdkVersion: 22 in your AndroidManifest.xml file" when uploading APK for Flex 2

I am trying to upload a new version of an app I am creating for Clover Flex 2, but I am getting this error:


Devices: Flex[21] do not meet minSdkVersion: 22 in your AndroidManifest.xml file.


If I try to manually add minSdkVersion property to my AndroidManifest.xml file, gradle would complain about that property should be included in a gradle script.... and my app gradle script DOES contain minSdkVersion 22 already.

Any ideas of what could be the problem?


P.S.: not sure if related, but I am using Ionic + Cordova to build this app, and last year I as able to build and upload several versions of this app without problem.

SandboxClover Flex
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

victorespina avatar image
victorespina answered victorespina edited

just realized what the real problem is... I misunderstood the error message; its actually complaining about the actual value of minSdkVersion, because its setted to 22 and the rules were expecting 21 or less.... this would be a HUGE complication for me, because it would force me to move back to a previous version of Ionic and cordova. Pufffff.....


**IMPORTANT**

Thanks to David Marginian for clarifying the cause of my problem. I transcribe here his comment for future references:

The API level that the device is running at is not technically the same as the minimum SDK version, so the docs you were looking at (https://docs.clover.com/docs/clover-devices) aren't helpful for determining what versions to set in your manifest. You should be using https://docs.clover.com/docs/setting-android-sdk-versions.


So, according to the clover docs, the correct values for Flex/Flex2 apps would be:

minSdkVersion: 21
targetSdkVersion: 25
compileSdkVersion: 27




3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

I'll look into this. There may be something off with the upload rule.

0 Likes 0 ·
victorespina avatar image victorespina commented ·

I finally get the sandbox to accept my app, by downgrading my Cordova version to 8.1.2 and setting cdvMinSdkVersion to 21 and cdvTargetSdkVersion to 25 in the gradle.properties file on my Ionic project.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ victorespina commented ·

Yes, 21 is the correct minSdkVersion for Flex. https://docs.clover.com/docs/setting-android-sdk-versions

0 Likes 0 ·
David Marginian avatar image
David Marginian Deactivated answered victorespina commented

Are you sure your app doesn't support Flex 1? https://docs.clover.com/docs/setting-android-sdk-versions

7 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

victorespina avatar image victorespina commented ·

Good point. Yes, my app should work with both Flex and Flex 2 devices. I will adjust the value of minSdkVersion to 17 and see if this solves the problem. Thanks.

0 Likes 0 ·
victorespina avatar image victorespina victorespina commented ·

According to Clover devices docs, Flex model requires API Level 22, while Flex2 requires API Level 27. I just made sure that my project meets does requirements, by using minSdkVersion = 22 and targetSdkVersion = 27, but I am still getting the same error when trying to upload my signed APK to the Clover's sandbox.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ victorespina commented ·

Try setting it to 21, and let me know. I will need to look at the docs you linked, maybe they are inaccurate. I am not 100%. https://docs.clover.com/docs/setting-android-sdk-versions

0 Likes 0 ·
Show more comments
victorespina avatar image
victorespina answered David Marginian Deactivated commented

I just used apktool to extract the AndroidManifest.xml included in the APK being rejected, and as far as I can see, the minSdkValue IS present:


<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:hardwareAccelerated="true" android:minSdkVersion="22" package="com.noi.payapp" platformBuildVersionCode="29" platformBuildVersionName="10">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:maxSdkVersion="27" android:minSdkVersion="22" android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:maxSdkVersion="27" android:minSdkVersion="22" android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <application android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true">
        <activity android:configChanges="keyboard|keyboardHidden|locale|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="com.noi.payapp.MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>


1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

Did you see my previous comment:

Try setting it to 21, and let me know. I will need to look at the docs you linked, maybe they are inaccurate. I am not 100%. https://docs.clover.com/docs/setting-android-sdk-versions

At a minimum there appears to be a discrepancy between the https://docs.clover.com/docs/setting-android-sdk-versions (which seems to indicate you need to set your minSdk to 21 for Flex) and https://docs.clover.com/docs/clover-devices (which says 22). Obviously, you have it set to 22 and it isn't working so try setting it to 21.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community