I have created an android application using Android Studio. I have this code in the manifest file:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
and the value for #integer/google_play_services_version is 520800 (value added automatically when I linked the Google play library. No hardcode there).
This is the link between the library and the project
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services:+'
}
also auto generated when I have added the Google play library from the menu.
The application works fine, bun when I generate a signed APK and try to upload it to the Google market it gives me an error saying that I am trying to upload an APK which uses google play version 5208000 and I should use version 5100000 or lower.
I have tryed to google_play_services_version into 5100000 but then the application stops working from the beginning.
How should I make my app runnable and valid for uploading on the market?
The problem is with this instruction:
compile 'com.google.android.gms:play-services:+'
the play-services:+ means that it will pack the very latest play-services version. The problem is that the very latest play-services version available on the development environment is not yet fully published worldwide by Google, therefore not yet available to be used in official builds. So you have to use a version that it is indicating or lower..like this one: play-services:5.0.89.
So this one will work:
compile 'com.google.android.gms:play-services:5.0.89'
To find a list of available version, take a look at this folder in your SDK: extras/google/m2repository/com/google/android/gms/play-services/
Good luck!
Use this setting in your app's build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:5.0.89'
}
I found the solution posten on the XDA Developers forum:
http://forum.xda-developers.com/coding/java-android/google-play-version-t2845409
Maybe you have same problems with your libraries. You should use the lib that supports last GP version. Please type logs for details.Also try to compile 'com.android.support:appcompat-v7:20.0.+'
Related
I am upgrading an App, and in my build.gradle file, I have this:
dependencies {
..........
compile 'com.google.android.gms:play-services:9.8.0'
..........
}
In the Android SDK Setup Quickstart Guide Urban Airship provides, they offer this as a sample code:
dependencies {
..........
// Recommended for location services
compile 'com.google.android.gms:play-services-location:9.8.0'
..........
}
If I use "play-services:9.8.0" I would assume it would also include "play-services-location:9.8.0" because "play-services-location:9.8.0" should be a subset of "play-services:9.8.0", but I wanted to confirm. Do you know if this is a correct assumption? Thank you.
From Google Api Documentation
you can use the latest Google play service api:
dependencies {
compile 'com.google.android.gms:play-services:10.2.1'
}
If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them.
To Selectively compiling APIs into your executable:
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-plus:10.2.1'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.google.android.gms:play-services-games:10.2.1'
compile 'com.google.android.gms:play-services-gcm:10.2.1'
the detail lists are provided in the documentation.
Yes, play-services is the full bundle. They were broken apart to reduce the method count of your app so you don't hit the dex limit. More information can be found here.
I have an Android project created in Eclipse which uses google play services and Facebook sdk libraries to login through google+ and Facebook. When I import this project to Android Studio and generate an apk, the google+ and Facebook login do not work.
They work fine in the apk generated by Eclipse however. I am not sure what causes this problem, the way use google services has changed in Android Studio and it just requires adding a dependency instead of adding the library. I searched this topic but could not find someone with the same problem. I need to know what changes to make in the project so it works properly.
Any help is highly appreciated.
Current dependencies in the imported project.
dependencies {
compile project(':facebookSDK')
compile project(':googleplayservices_lib')
compile project(':dateTimePickerMaterialLibrary')
compile 'com.google.code.gson:gson:2.4'
compile 'joda-time:joda-time:2.9.2'
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/universal-image-loader-1.9.4.jar')
}
I am building an android app which uses google play services for google maps and Microsoft azure for mobile services(cloud storage).
When i use just Microsoft azure libraries i don't face any problems but when add google play libraries it gives me the following error.
Error
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.gson.GsonBuilder
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.createMobileServiceGsonBuilder(MobileServiceClient.java:192)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.<init>(MobileServiceClient.java:179)
at com.microsoft.windowsazure.mobileservices.MobileServiceClient.<init>(MobileServiceClient.java:158)
at com.example.jino.navigationplacepicker.ReviewPage.onCreate(ReviewPage.java:27)
this is library dependency structure from my gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.google.code.gson:gson:2.4'
compile files('libs/azuresdk-android-2.0.3/mobileservices/guava-17.0.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-javadoc.jar')
compile files('libs/azuresdk-android-2.0.3/mobileservices/mobileservices-2.0.3-sources.jar')
compile 'com.google.android.gms:play-services:8.4.0'
}
Hope you can help me out. Thanks in advance.
When you include compile 'com.google.android.gms:play-services:8.4.0' all of the play services packages are included. If you only need maps from play services, use compile 'com.google.android.gms:play-services-maps:8.4.0' instead.
See here for a list of play services modules. I am currently testing all of the modules to see which might be the culprit. Stay tuned for an update if you are curious.
I am currently unsure exactly what causes this problem. Using the entire play services collection works on most of my devices, but not any of my Android 4.4.4 devices.
UPDATE: The issue is more likely due to number of packages used and not specific packages not being compatible with Azure. Probably related to the total method count exceeding 64K (DEX64K error).
Continue using specific modules and you should be fine.
This question already has answers here:
Google Play: We found Ad SDKs in your application
(5 answers)
Closed 7 years ago.
I've got an Android application that is being submitted to the Play Store. That application is built using the same Gradle build script but has several different product flavors being built which just set properties for different application ID's and names for each different flavor.
The problem we have is that AdMob is 'not' included in the build script, but some of the build flavors that are being submitted the Play Store is reporting that AdMob was found in the application. But other flavors (built from same build script) are accepted fine without any AdMob notification.
Has anyone seen this issue and possibly know what might be triggering it? Besides our own internal libraries, this is what's being included in the dependencies of the build script:
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile group: 'com.android.support', name: 'support-v4', version: '21.0.3'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'com.google.android.gms:play-services:6.5.87'
// ViewPagerIndicator Library
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile fileTree(dir: 'libs', include: '*.jar')
}
I've checked the 'libs' directory but we only have 3 jar files in it that have just some included class files so there isn't any SDK's in that directory.
This is what the Play Store is reporting:
In your gradle build script you have:
compile 'com.google.android.gms:play-services:6.5.87'
This means that all Google play services are included into your project (including AdMob as well).
Instead, you should include only play services that you need. For example:
compile 'com.google.android.gms:play-services-fitness:8.3.0'
compile 'com.google.android.gms:play-services-wearable:8.3.0'
Take a look at this guidelines.
You are using Google Play Services which includes Admob.
You can exclude Admob by only referencing the Google Play Services libraries you actually require instead of the complete set.
More details here on how to do that:
More Permissions in uploaded apk than in manifest file
I am using google play services API, and from old version of code, i included the whole library. Now i want to use Selectively compiling APIs from this link https://developers.google.com/android/guides/setup. But i can't find what does com.google.android.gms.appstate.AppStateManager come from .
I already have this
compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-games:7.5.0'
compile 'com.google.android.gms:play-services-plus:7.5.0'
but none of them have.
Please help.
The AppStateManager of the Google Play Services is DEPRECATED, so they have hidden the AppState play-services-dependency.
At the moment you can still get it via the following dependency, but it will probably get deleted soon.
compile 'com.google.android.gms:play-services-appstate:7.8.0'
or for Updated version use
implementation 'com.google.android.gms:play-services-appstate:8.4.0'
Add the following dependency in build.gradle rember this is for old DEPRECATED
compile 'com.google.android.gms:play-services-appstate:9.0.0'
This is work for me