I've been diving around StackOverflow, Medium, and some Google, but haven't found the solution yet.
I'm currently using an ejected Expo App. I need to upgrade the compileSdkVersion
and targetSdkVersion
to 31 as Intercom currently needs it.
While everything else remains the same, once I change the compileSdkVersion
and targetSdkVersion
to the aforementioned values and download the compiled .apk eas build --profile development --platform android
I get hit in my S10e (Android 12) with There was a problem parsing the package.
I've tried running it on an Android 9 emulator and it fails as well. Nonetheless, a Samsung Galaxy S10 with Android 11 runs it well.
If I downgrade the version to 30, the project resumes and it runs well again.
I've researched all these links (and more)
- Cant install app from PlayStore for Android 12 targetSDK 31
- apk install failed on android 12
- https://medium.com/@lewwybogus/fixing-there-was-a-problem-while-parsing-the-package-on-android-12-d62365d5a8b
- What is the use of android:exported="true" in BroadcastReceiver
- Android Studio error: "Manifest merger failed: Apps targeting Android 12"
- Android 12 (API level 31) can't start ExoPlayer from the service
- Parse error: there is a issue while parsing the package in marshmallow
From what I've gathered, I need to update the <application>
and <service>
s tags with android:exported="true"
accordingly.
I did that, but the .apk is still uninstallable on my device.
Here's the AndroidManifest.xml
from src/main
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.omitted">
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"/>
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="44.0.0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/omitted"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="app.pana"/>
<data android:scheme="exp+pana"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="true"/>
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:theme="@style/Base.Theme.AppCompat" android:exported="true"/>
</application>
</manifest>
eas.json
{
"cli": {
"version": ">= 0.47.0"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal",
"android": {
"image": "ubuntu-18.04-jdk-11-ndk-r19c"
}
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
Here's part of the build.gradle:
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))
}
maven {
// Android JSC is installed from npm
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
}
google()
mavenCentral()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
I don't know what else to do. Any ideas?