I have a old project that uses ActionBarSherlock library and old google play services project in workspace. Now, I need to add push notification to the project but, for this, I need compile com.google.firebase:firebase-messaging:9.4.0 then I have an exception "more than one library with package name 'com.google.android.gms'. The issue is I need keep old google play project module because this project used old version of google maps with reference to getMap() within SherlockMapFragment.
How to I compile firebase and old google play project?. From old google play project only need maps component, could I compile one service from google play project?
Thank you in advance!
Probably try this :
Remove old library of google play services, and keep the last 3 digits
Add firebase library
com.google.firebase:firebase-messaging:9.4.0
Add the needed part of the old library with the last 3 digits
com.google.android.gms:play-services-maps:X.Y.Z
Related
How to fix below error in Google Play store(React native)
Your app is using an unsafe implementation of hostname verifier. Please see this Google Help Centre article for details, including the deadline for fixing the vulnerability.
Lh/a/a/a/a/l/e$a;
Lh/a/a/a/a/l/f$a;
Your project or any libraries may use an unsafe hostname verifier. You may successfully updated this app using the same code without any error on previous time. But it is a new review strategy from google play.
If you are not sure which package is used this unsafe-hostname, you can contact google play support team using the link: https://support.google.com/googleplay/android-developer/contact/app_vuln
Don't forget to select the same Google account to which you have uploaded your project
You will receive an email within 2 or 3 business days with details of this issue, including the name of the library that used the unsafe-hostname.
You can upgrade this library to the latest version, or you can remove this if you are actually not implementing this library in your code.
I got the following detailed email from google when I contacted with the above link.
*
For example, your app is currently using the following vulnerable
implementation of HostnameVerifier:
Llib/android/paypal/com/magnessdk/network/d$1;
Llib/android/paypal/com/magnessdk/network/e$1;
My project was not using the PayPal library directly, but paypal is used by another library "braintreepayments". Actually, I am not using this library in my live project, I added this at the initial time of my project. So I commented this library in app/build.gradle, this fixed my issue.
From where to download the google-play-services aar files for version 11.6.0 OR above 11.0.4
I know just by adding the dependency in apps build.gradle adds the library in it.
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.google.android.gms:play-services-ads:11.6.0'
This is fair in case of Android Studio.
But as a Unity Developer, I have downloaded the Google Mobile Ads Unity Plugin which after import gives the play services ads, lite, basement, gass of version 11.6.0
Now we have some location dependency in our project. So I have downloaded the Android SDK and its stored in this path.
/Users/USERNAME/Library/Android/sdk
After navigating to /Users/USERNAME/Library/Android/sdk/extras/google/m2repository/com/google/android/gms,
I got the latest play services library of version 11.0.4 only and if I tried to create a Android Studio project by adding GPS dependency of 11.6.0, its getting added properly.
So my question is,
where google play services library of version 11.6.0 is downloaded. So that I can go to that location and get all the aar file needed for my Unity Project
Following are the details from Android developer documentation:
Programmatic access:
For programmatic access to Google's Maven artifacts, you can get an XML list of artifact groups from maven.google.com/master-index.xml (link) which gives the group path
Then, for any group, you can view its library names and versions at:
maven.google.com/group_path/group-index.xml
For example, libraries in the android.arch.lifecycle group are listed at maven.google.com/android/arch/lifecycle/group-index.xml (link).
You can also download the POM and JAR files at:
maven.google.com/group_path/library/version/library-version.ext
For example:
maven.google.com/android/arch/lifecycle/compiler/1.0.0/compiler-1.0.0.pom. (link)
For more details please refer:
https://developer.android.com/studio/build/dependencies.html#gmaven-access
For complete list of Google Play Services libraries, refer below xml:
https://dl.google.com/dl/android/maven2/com/google/android/gms/group-index.xml
Eg: To download Google Play Services Location library AAR file, use the following link:
https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-location/11.6.0/play-services-location-11.6.0.aar
You can replace group name, version, file, extension to download other files.
Note: Do check the pom file for each module, it may have dependencies on other Google Play Services libraries. If so, you will need to download all dependent files.
[Update]:
You can use Google's Unity Jar Resolver for this:
https://github.com/googlesamples/unity-jar-resolver
Check the links below:
play-services-ads-11.6.0
play-services-location-11.6.0
You can find and download all versions of the aar libraries at the MVN repository.
Also:
I came across a github project for Titanium/Appcelerator/AxWay. It has a script that downloads the latest play-services libraries.
The project is at: https://github.com/appcelerator-modules/ti.playservices
The relevant script is: updater/index.js
Hopefully the script will not go away because it is very useful.
I need to create an Android Library that uses google's gcm and location services. Initially I did it inside the application's module and everything went fine.
Now I need to create an Android Library to be used by more than one app, and I'm having a lot of problems:
The first one is that my lib doesn't have a google-services.json file, since it should use the app's module to configure itself. So google play services plugin is not working on the libs' build.gradle file.
The second one is that it seems that google play services plugin detects that I'm not calling apply plugin inside the lib's build.gradle and uses by default the version 9.0.0 of the library, even when I'm configuring it to use 10.0.1. So I'm also having a strange problem to run my app, Unable to execute dex: Multiple dex files define ...
What's the right way to create an Android library that uses google-play-services which can also coexist with an Android Application that also uses google-play-services?
First of all in your library, in the build.gradle you have to remove the line
//apply plugin: 'com.google.gms.google-services'
Since you can't have a google-services.json file, you can't use the plugin.
You have to add the dependencies needed, and it is enough to compile to library.
Instead in the projects which will use the library, you have to add the plugin and the google-services.json file.
I have faced a similar situation and concluded that:
1- Android Library should have it
google-services.json
file and should also declare dependencies and google services plugin.
2- App using the library can have their own
google-services.json
file and dependencies declared.
The point to be noted here is that we should use the same versions of dependencies and google services plugin.
Also while adding library dependency,
transitive = true
is added.
I found in the internet that this error of yours is usually caused by multiple copies of library(duplicate) that you are using in your project. Go into the Project Structure -> modules, then check in the target or the apk-libs folder if there are more than one copy. After this, do a clean and build the project.
For more solution about this issue, check this related SO question.
Now, for your question about creating an Android library that uses google-play-services, try to check this tutorial if it can help you. It provides screenshot that you can follow.
For more information, check these threads:
Set Up Google Play Services
Android Studio with Google Play Services
Import Google Play Services library in Android Studio
Adding Google Play Services Library to Your Android App
Even after invalidating caches and restarting Android Studio. The only thing that solved my problem was restarting the computer. Don't know how, but suddenly everything was correct again.
I have a important library project that is used by some projects.
When I implement google analytics in the library project it works fine. But When I implement same to the main projects who use this library project, It only shows analytics data for the activities that are only present in the package.
e.g. case 1 : implementing Google analytics in library project
works Fine
case 2: implementing Google analytics in main project
data showing for only the package in which we have configured
com.mainproject.MyActivity
No data displays for in library package com.librarypackage.MyLibraryActivity
Any easy solution for this so that I can get analytics data for the library project as well that is for a different package.
I'm trying to implement GCM in an Android project with Android Studio 1.0.
I've installed Google Play Service library but I'm confused about ,how to import the one to project.
Does anyone know how to do it?
Thanks in advance!
Since you are using Android Studio, you are presumably also using Gradle. If this is the case, then you do not need to worry about importing any projects.
Simply open up the build.gradle in your app module, and locate the depencies {} closure.
Inside of this section, add the Google Play Services dependency like so:
dependencies {
// ...
compile 'com.google.android.gms:play-services:6.5.+'
}
Once you have done that, you can use any classes from Google Play Services anywhere in your application.
Be sure to read through the Setting up Google Play Services documentation, as you also need to include a <meta-data> element in your manifest, and you can also choose to selectively include only the parts of Google Play Services that you will be using.