Closed itpixelz closed 2 years ago
Hi @itpixelz
This error usually arises when you decide to set your target SDK to target android 12 (SDK 31).
To fix the error, you need to add this line android:exported="true"
to the <activity>
(MainActivity) in the AndroidManifest.xml.
Thank you so much for your response @Techsorcist. I have checked my file AndroidManifest.xml
and it is already set android:exported="true"
to the <activity>
.
Here is the file AndroidManifest.xml
.
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="10000" android:versionName="1.0.0" package="io.cordova.hellocordova" xmlns:android="http://schemas.android.com/apk/res/android">
<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" />
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@style/Theme.AppCompat.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>
<meta-data android:name="com.pushwoosh.log_level" android:value="DEBUG" />
<meta-data android:name="com.pushwoosh.foreground_push" android:value="false" />
<meta-data android:name="com.pushwoosh.notification_service_extension" android:value="com.pushwoosh.plugin.pushnotifications.PushwooshNotificationServiceExtension" />
<meta-data android:name="com.pushwoosh.internal.plugin_provider" android:value="com.pushwoosh.plugin.internal.PhonegapPluginProvider" />
</application>
</manifest>
@itpixelz The latest versions of the plugin are dependent on androidx.work:work-runtime:2.7.+
library, and those versions require targeting Android API 31 or higher. To fix the build issue, you should add the following line to your config.xml:
<preference name="android-targetSdkVersion" value="31" />
In my Cordova app, without this pushwoosh-cordova-plugin, the app build is successful but when I add this plugin. When trying to build the Cordova app, it fails with the following error.
Here is package.json file