transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.66k stars 426 forks source link

Poly License could not be validated (And we are not trying to use it) #2135

Closed joshuadunning closed 1 month ago

joshuadunning commented 2 months ago

Your Environment

Expected Behavior

After version bumping up from 4.16.3 to 4.16.5 or 4.17.0, I expected all license keys to still be validated properly. We DO NOT use the polygon addon, and therefore do not have a key defined; however we still receive the license validation error for the polygon plugin.

After digging into the AndroidManifest.xml I found

    <meta-data android:name="com.transistorsoft.locationmanager.hms.license" android:value="UNDEFINED"/>
  + <meta-data android:name="com.transistorsoft.locationmanager.poly.license" android:value="UNDEFINED"/>

On version 4.16.3 and lower, the poly.license is not present and does not throw the error.

On version 4.16.5 and 4.17.0, the poly tag is added. I tried removing the meta-data tag for the poly license and the error was still present (I'm sure the license check is somewhere else in the packages).

Actual Behavior

Error pops up: License could not be validated for: com.transistorsoft.locationmanager.poly

Steps to Reproduce

  1. npx expo prebuild --clean with "react-native-background-geolocation" 4.16.5 and 4.17.0
  2. build a release apk file
  3. Open app and see validation error

For right now, I just downgraded us to 4.16.3 until we learn more.

We will stay on 4.16.3 for now. The new versions don't seem relevant to our use case.

Happy to provide more details as needed.

christocracy commented 2 months ago

4.16.5 was exactly a fix for this:

https://github.com/transistorsoft/react-native-background-geolocation/blob/master/CHANGELOG.md#4165--2024-07-12

joshuadunning commented 2 months ago

I saw that changelog which was very odd as I swapped back and forth multiple times cleaning the android folders each time and only downgrading to 4.16.3 fixed it. I'll give it another test and update here again.

christocracy commented 2 months ago

I will investigate today. I quickly released that fix in 4.16.5 before leaving for vacation in early July. Feedback from those who reported this was that the fix was successful.

christocracy commented 2 months ago

I think I possibly see a problem. If those unused keys were poked into your AndroidManifest using a previous version, then they won't automatically be removed.

<meta-data android:name="com.transistorsoft.locationmanager.hms.license" android:value="UNDEFINED"/>
<meta-data android:name="com.transistorsoft.locationmanager.poly.license" android:value="UNDEFINED"/>

I'm going to add some more logic to explicitly remove unused keys from AndroidManifest where those keys are not provided in your app.json.

christocracy commented 2 months ago

Ok, I've released this fix to 4.17.1 and back-ported to 4.16.6.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale.