transistorsoft / cordova-background-geolocation-lt

The most sophisticated background location-tracking & geofencing module with battery-conscious motion-detection intelligence for iOS and Android.
http://www.transistorsoft.com/shop/products/cordova-background-geolocation
Other
655 stars 277 forks source link

Target SDK 31 and android:exported #1358

Closed dimitriscsd closed 1 year ago

dimitriscsd commented 1 year ago

Since the plugin requires compilesdkversion 31, I have set the targetsdkversion in config.xml to 31. That changes both compile and targetsdkversion to 31. I don't know of a way to just change compile since this is an ionic project.

After doing that, I get the following error on build:

Task :app:processDebugMainManifest FAILED /Users/matanis/Code/vincarrier/platforms/android/app/src/main/AndroidManifest.xml Error: Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

The problem is if i check my androidmanifest, it does have android:exported="true" on the activity that specifies that intent. There is however another activity (FCM plugin) which doesnt have it, but that one does not have any intents...

Your Environment

❯ ionic info

Ionic:

Ionic CLI : 6.20.1 (/Users/matanis/.nvm/versions/node/v16.13.1/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 6.0.1 @angular-devkit/build-angular : 13.1.2 @angular-devkit/schematics : 13.1.2 @angular/cli : 13.1.2 @ionic/angular-toolkit : 5.0.3

Cordova:

Cordova CLI : 11.0.0 Cordova Platforms : android 10.1.2, ios 6.2.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 19 other plugins)

Utility:

cordova-res : 0.15.4 native-run (update available: 1.6.0) : 1.5.0

System:

Android SDK Tools : 26.1.1 (/Users/matanis/Library/Android/sdk) ios-sim : 8.0.2 NodeJS : v16.13.1 (/Users/matanis/.nvm/versions/node/v16.13.1/bin/node) npm : 8.6.0 OS : macOS Monterey Xcode : Xcode 13.4.1 Build version 13F100

This plugins version is: 4.8.0

Expected Behavior

Successful build since I have android:exported="true"

Actual Behavior

Task :app:processDebugMainManifest FAILED /Users/matanis/Code/vincarrier/platforms/android/app/src/main/AndroidManifest.xml Error: Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

Steps to Reproduce

  1. Install plugin as described in the docs

I am providing my androidmanifest below, since it might be useful:

`<?xml version='1.0' encoding='utf-8'?>

`

dimitriscsd commented 1 year ago

I just noticed that the FCM plugin i am using, declares an intent and that doesnt define exported:true

I suppose that is the issue... I will have another look changing that and see if it builds.

christocracy commented 1 year ago

The plugin defines android:exported everywhere required. If you are seeing this error, it can only be caused another of your own plugins.