Why does Localytics require google-play-services:ads? - android

I was running into problems with how many methods I have in my project, and have finally fixed it.
However, I noticed that the Localytics documentation says to include the dependency com.google.android.gms:play-services-ads. It is never used anywhere in my project, and I can't find anything on their website as to why its a required dependency.
My app runs perfectly fine without it as far as I can tell, but I have only tried building the project as a debug build.

play-services-ads used to be the only way of gaining access to the Advertising ID and it seems that functionality was added back in version 2.60 as per the SDK Changelog. The only mention of it appears to be in the testing attribution section, although that doesn't mean it is only used for attribution.
As of Google Play services 9.0, it has been moved to the play-services-basement dependency, which is much smaller. You should be able to use that dependency in place of play-services-ads without issue.

Related

How to force android studio to use different library versions for project and library

I have a project using an old version of google play services that I need to keep otherwise it would need to be heavily rewritten. Now I have added a new library that uses a newer version of google play services and I get a duplicate class error.
How can I force android studio to use the newer version of google play services in the library for the library but also be able to use the older version in my app?
Unfortunately, this isn't possible. The classes for your app and the library are combined to form your APK, so you can only have one version of a given library. You could force it to use one of the two versions (for example, something like this), but based on your statement that it would need to be extensively rewritten, I assume that the two versions are not API compatible.
There are utilities like Jar Jar Links that can solve this in some cases, but (especially based on the embedded proguard rules, which reference classes found via reflection) I'd be surprised if it worked in the case of something as complex as Google Play Services, which is likely depending on its class names remaining unchanged.

How to declare dependencies on cordova project.properties file?

I'm developing an android game with cordova 7.1.0 and I would love to know the meaning of the "+" symbol used on the "cordova_project\platforms\android\project.properties" file. So, what would be the difference between this:
cordova.system.library.1=com.google.android.gms:play-services-games:11.0.4
cordova.system.library.2=com.google.android.gms:play-services-plus:11.0.4
cordova.system.library.3=com.google.android.gms:play-services-ads:11.0.4
And this:
cordova.system.library.1=com.google.android.gms:play-services-games:11.0.4+
cordova.system.library.2=com.google.android.gms:play-services-plus:11.0.4+
cordova.system.library.3=com.google.android.gms:play-services-ads:11.0.4+
I really want to understand the use of the "+" symbol because after 1st of November I'll not be able to update older versions of my app because they don't target API 26. I don't want my old versions of the app being unable to login to Google Play Games or to stop showing ads.
Thanks a lot in advance
In Gradle, the "+" is for dynamic version of your dependencies.
Ideally, your builds should be predictable and consistent.
Based from this blog, here are the problems you will encounter if you don't specify your dependency explicitly:
Dependencies can unexpectedly introduce behavior changes to your app.
The same source built on two different machines can differ.
Similarly, builds built on the same machine but at different times can differ.
Past builds cannot be reproduced perfectly. This makes it difficult to revert safely.
There are security implications if a bad actor introduces a malicious version of a dependency.

Crash reporting in Library module

I have already tried crashlytics but it is not supported.
this is the reply i got from their team
Thanks for reaching out on this and Crashlytics, or any part of Fabric, cannot be included in any SDK that is distributed to external apps. As you mentioned, this will cause conflicts for both the SDK and app. With that said, we do hope to support this in the future and if you'd like, I can keep you updated on that.
I have tried to set my own UncaughtExceptionHandler for this but the problem with that is my library also starts to catch error of the client's application module.

Xamarin Android Support lib references broken since installing Google Play Services

I have a project that I attempted to install Google Player Services through NuGet. Since trying to install the google package, my android support libraries as well as the google play service libraries are all showing up in my references as broken, no matter how I try to add, reinstall or change the references. They always break, throwing The "ResolveLibraryProjectImports" task failed unexpectedly. as an error in response.
I have looked around and tried everything that sounded remotely like my issue, to no avail. Any help would be appreciated.
I am running Xamarin v4.3.0.789 (4d2ed3d) with Xamarin.Android v7.1.0.43 (4a52f1e)
Not entirely sure why this fixed the issue. However after looking through, I realised that version of my packages had been updated, I assume that Google Player Services forced that, which then caused my whole project to go haywire.
Installed the version of packages I was using beforehand and it works again.

Facebook SDK upgrade and android.support v7:25

So I recently tried running my app which had been working fine until facebook updated their sdk which caused problems with different variations of android.support v7:25.
The dependency that caused the issue was 'com.facebook.android:facebook-android-sdk:4+'. To fix the issue i just specified a version that I wanted.
My question is, will this cause my apps that have already been published with the 4+ dependency to crash and should I immediately update my app with the specific version?
Yes, you should always define any dependencies with specific version ( As per experience I do have).
You should not define dependencies like this with any of i.e. with Facebook or Google etc.
If you use dependencies like defining 4+, then it upgrades automatically when required.

Categories

Resources