ive built a meteor cordova app that runs very well on my android 11. but it wont run on android 12 (crashes without opening at all)
im a newbee to android development (config.xml n manifest etc is all unknown) so ive this mobile-config file
// Add custom tags for a particular PhoneGap/Cordova plugin to the end of the
// generated config.xml. 'Universal Links' is shown as an example here.
App.appendToConfig(`
<platform name="android">
<preference name="android-targetSdkVersion" value="31" />
<preference name="android-minSdkVersion" value="24" />
<activity android:name=".otherActivity" android:exported="true"/> </platform>
`);
App.appendToConfig(`
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application/activity" xmlns:android="http://schemas.android.com/apk/res/android">
<activity android:exported="true"/>
</edit-config>`);
any help from experts on any obvious mistakes or any links to such tutorials will help me a lot. Many thanks!
@digisarathi Hello! What errors do you get on the console?
Besides setting the exported flag (as you already did), you also need to ensure that the Java version that meteor uses to build the app is at least 11 and update your cmdline-tools version to the latest one.
ive now upgraded cmdline-tools to latest (7.0) it was 6.0 before.
I don’t get any specific errors on console (dot log you mean?) I’ve android 11 and it works fine there. on my friend’s android 12, it doesn’t start at all. it just says ‘App crashed too many times’
I’m trying to get my hands on an android 12 to debug further and get back here with more details.
many thanks for your support!
kind regards.
@digisarathi This seems like a plugin issue, probably you have a plugin that isn’t compatible with the newest android API. What’s your cordova-plugins file? One way to go here would be to remove one by one and check if the error still occurs. If you find the broken plugin, you will need to create an issue on the respective repository or fix it with a fork.
Hey! thanks so much. so I use only one plugin cordova-plugin-admob. it is the latest version 3.2.5 and I guess thats what is crashing the app. I will check with the plugin makers regarding this and update this thread.
If anyone knows what a better plugin to use to show google Ads in the mobile app, please do share.
many thanks!