Skip to content
Advertisement

Application not compatible with older Android versions

I’m generating an Android application via mvn -Pandroid gluonfx:build gluonfx:package. Here are the versions from the POM:

        <maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>
        <maven-surefire-plugin-version>3.0.0-M6</maven-surefire-plugin-version>
        <javafx-maven-plugin-version>0.0.8</javafx-maven-plugin-version>
        <gluonfx-maven-plugin-version>1.0.14</gluonfx-maven-plugin-version>

        <java-version>17</java-version>
        <javafx-version>18.0.1</javafx-version>
        <charm-version>6.1.0</charm-version>
        <attach-version>4.0.15</attach-version>

Using graalvm-svm-java17-linux-gluon-22.1.0.1-Final

The application works well on Android 8. However, when trying to install it on Android 7.0, a message pops up saying that the application is not compatible with the device. I’m not sure where the default version is specified, but following the instructions, I copied the manifest file, which was

<?xml version='1.0'?>
<manifest xmlns:android='http://schemas.android.com/apk/res/android' package='my.app.demo' android:versionCode='1' android:versionName='1.0'>
    <supports-screens android:xlargeScreens="true"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    
    <application android:label='MyApp' android:icon="@mipmap/ic_launcher">
        <activity android:name='com.gluonhq.helloandroid.MainActivity' android:configChanges="orientation|keyboardHidden">
             <intent-filter>
                <category android:name='android.intent.category.LAUNCHER'/>
                <action android:name='android.intent.action.MAIN'/>
             </intent-filter>
        </activity>
        <activity android:name='com.gluonhq.helloandroid.PermissionRequestActivity'/>
    </application>
</manifest>

and added a line for supporting sdk 24 (matches Android 7.0):

    ...
    <supports-screens android:xlargeScreens="true"/>
    <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="24"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    ...

Then I put it in my project under src/android/AndroidManifest.xml and ran mvn -Pandroid gluonfx:build gluonfx:package again. The APK was generated successfully, but upon installation the same error message appeared.

How do I install the app on Android 7.0?

Advertisement

Answer

As mentioned in the comments, the device uses an ARMv7 processor, which uses a 32bit architecture. GraalVM supports only 64 bits, so the APKs produced by it will work only on devices with 64bits, like those with ARMv8.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement