Android library depends on proprietary Google GMS SDK
Kaned1as opened this issue · 10 comments
#94 got closed, so reopening here
When running this SDK on an Android phone that does not have Google Play Services it constantly shows notification "Enable Google Play Servces", "This app won't work unless you enable Google Play Services".
So it is impossible to use it without installing Google Play.
This is because of this line:
Line 63 in 3705497
This also blocks using this library in any of the applications published in F-Droid, which is unfortunate.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Not stale
NewNode uses Google Nearby, which apparently depends on Google Play Services. What prevents you from installing those?
What prevents you from installing those?
They are proprietary software.
NewNode uses Google Nearby, which apparently depends on Google Play Services.
Yes, and it doesn't work on phones that don't have Google Play Services.
Look, if your software depends on Google, that's fine, I'm not saying what's right or wrong, just trying to clarify whether this can be used for anything published on F-Droid. F-Droid has very strict requirements for publishing, and the main one is the app shouldn't have any proprietary dependencies, even transitive.
If you say it's by design, right y'are, chief, I'll just close this issue.
I would be happy to accept a pull request which made this dependency optional. (I would also be happy to accept a pull request that implemented device-to-device connectivity without using Google Nearby -- that's a much larger project.)
You might be pleased to learn that device-to-device connectivity without using Google Nearby has been implemented and will be released shortly.
Anyone know how to make the Google Nearby dependency optional?
Anyone know how to make the Google Nearby dependency optional?
Put compileOnly
instead of implementation
in build.gradle. But this way you'll need to check for classes from it in runtime, to see whether it is available or not. Or document how to use classes so that code paths that correspond to Google Nearby are not touched in any way.
This is implemented in 29f06f0 It will be released shortly.
Note: Using compileOnly
would prevent the published maven release from importing the dependency automatically, and would force all apps to specify the dependency by hand. Instead, if you want to avoid the Nearby dependency, import the aar
manually and simply leave out the dependency and the code will now run without it:
dependencies {
// include AAR directly (must include dependencies)
implementation project(':newnode')
implementation 'com.bugsnag:bugsnag-android:4.7.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
// skip Nearby
//implementation 'com.google.android.gms:play-services-nearby:18.+'
}
Thank you, this is awesome.