Open dinonovak opened 2 years ago
hi, were you able to get a resolve to this? From the code here there was a fix added, but I get the same error as you do above
Are there any plans to update the nuget package once this fix is working properly? After 1/1/2023 Android 12 is required, and I will not be able to update my app. I will need to look for another geofence solution.
Are there any plans to update the nuget package once this fix is working properly? After 1/1/2023 Android 12 is required, and I will not be able to update my app. I will need to look for another geofence solution.
I would like the answer to this question as well. This is the most up-to-date geofence package on NuGet, that I could find, and it hasn't been updated since 2021.
I was able to update my app to android 12. Hopefully this will resolve the above error/ at least point in the right direction
Edit - 26/09/23:
You need to set your own AndroidManifext.xml in Droid project -> Properties as defined here.
In the AndroidManifext.xml amend/ add the following:
<manifest.... >
<uses-sdk android:targetSdkVersion="31" />
<!-- uses permission such as grant grant location permissions -->
<uses-permission .... />
<application android:label="App name" android:icon="@drawable/icon">
<!-- might not be need but added just in case
<meta-data android:name="com.google.android.geo.API_KEY" android:value="{key}" />
<uses-library android:name="org.apache.http.legacy" android:required="false" /> -->
<receiver android:enabled="true" android:exported="false" android:name="crc64c554f6b6abc76285.GeofenceBootReceiver"></receiver>
</application>
</manifest.... >
I was able to update my app to android 12. Hopefully this will resolve the above error/ at least point in the right direction
In the AndroidManifext.xml amend/ add the following:
<manifest.... > <uses-sdk android:targetSdkVersion="31" /> <!-- uses permission such as grant grant location permissions --> <uses-permission .... /> <application android:label="App name" android:icon="@drawable/icon"> <!-- might not be need but added just in case <meta-data android:name="com.google.android.geo.API_KEY" android:value="{key}" /> <uses-library android:name="org.apache.http.legacy" android:required="false" /> --> <receiver android:enabled="true" android:exported="false" android:name="crc64c554f6b6abc76285.GeofenceBootReceiver"></receiver> </application> </manifest.... >
Thanks for the suggestion, but that is not a fix. The AndroidManifest.xml is automatically generated. Therefore, any changes you make manually will be lost. CrossGeeks needs to update their NuGet package.
I was able to update my app to android 12. Hopefully this will resolve the above error/ at least point in the right direction In the AndroidManifext.xml amend/ add the following:
<manifest.... > <uses-sdk android:targetSdkVersion="31" /> <!-- uses permission such as grant grant location permissions --> <uses-permission .... /> <application android:label="App name" android:icon="@drawable/icon"> <!-- might not be need but added just in case <meta-data android:name="com.google.android.geo.API_KEY" android:value="{key}" /> <uses-library android:name="org.apache.http.legacy" android:required="false" /> --> <receiver android:enabled="true" android:exported="false" android:name="crc64c554f6b6abc76285.GeofenceBootReceiver"></receiver> </application> </manifest.... >
Thanks for the suggestion, but that is not a fix. The AndroidManifest.xml is automatically generated. Therefore, any changes you make manually will be lost. CrossGeeks needs to update their NuGet package.
Sorry @TheWatchfulOne missed the bit about the one you would create as defined here
edited my comment
The AndroidManifest is automatically generated but merges in the AndroidManifest.xml you set in the Droid project -> Properties.
@Maniacy2k I have now converted my project to Maui, so the editable AndroidManifest.xml is now located in the Platforms/Android folder. Your suggestion appears to have helped, thanks!
in multiplatform app iOS app works ok, starts, triggers events for android when trying to run app I am getting
Error AMM0000: android:exported needs to be explicitly specified for element <receiver#crc64c554f6b6abc76285.GeofenceBootReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for
android:exportedwhen the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
I tried fixing this issue by adding below to AndroidManifest.xml under application section
After that app starts OK, but is crashing when trying to start monitoring CrossGeofence.Current.StartMonitoring(geoSetup);
error is: Object reference not set to an instance of an object. in Plugin.Geofence
tried changing android:exported="true" to false, but same error.