jar mismatch from log cat on program run using google play service - android

im following a tutorial and i have encounter a couple of problem doing this tutorial from enter link description here and now this problem what seem to be the problem. i was able to generate the sha1 now and i have imported the google play service lib but now i have encountered this problem how did i come up with this and how do i fix this
UPDATE
i have this on my SDK
UPDATE
support folder looks like this

The jar mismatch is due to different version of the support library.
You can copy the android-support-v4/jar from sdk/extras/android/support/v4/android-support-v4.jar to the libs folder of both Google play services library project and your Android project.
Make sure you have the updated Support Library.
You can check Adding Support Libraries without Resources #
https://developer.android.com/tools/support-library/setup.html
Edit: The latest is rev 19.0.1 as shown in the below snap shot
To download
Edit :
Do you see this under sdk/extras/android/support . Then open v4 and copy the jars to both libs folder

Related

Phonegap [cordova 3.2.0] The Google Play services resources were not found

I have added google-play-services.jar into libs folder. Eclipse does not see any errors in project. However i am using phonegap framework, so build happens somehow with ant.
When i am compiling i am not getting any problems:
cordova build
Generating config.xml from defaults for platform "android"
Preparing android project
Compiling app on platform "android" via command "cmd" /c C:\Users\kmoizik\Desktop\BTCproj\bbdebug\platforms\android\cordova\build
Platform "android" compiled successfully.
but in a runtime i got this error in logcat:
The Google Play services resources were not found Check your project configuration to ensure that the resources are included
Anybody can help ?
Thanks
don't worry about this v13 of google play service is buggy and will be fixed in next release take a look at screenshot i'm having same in my app
the problem was in linking . You should link google play services as project library instead of throwing jar in the libs.

android can't import google play services

From SDK Manager I have download the google play services, but when I try to add this lib to my project from right click then import the existing android code into workshop then when I select the google play services lib from C:\Program Files (x86)\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib I got this error (see the pic below please) .
note
I have android support v4 (maybe this makes problems? I just tell you because I don't know if this would make mistakes).
Seems to be you have already imported the google-play-services_lib project and just deleted from eclipse ide but not in your hard drive workspace folder. Try deleting the google-play-services_lib project from your workspace folder and try importing the project again.
And make sure "Is Library" is checked in properties->Android of google-play-services_lib project.
The Maps APIs for Android have been updated in the latest release of the Google Play Services library and have been rolled out to Android devices with the Play Store.
Please check this link.
if you have any query comment below.
Seems that library already installed check my step by step tutorial to see if how you missed some step in using google map android v2 on emulator(android 4.2.2) have a look at to my blog: http://umut.tekguc.info/en/content/google-android-map-v2-step-step

Where is com.google.android.gms?

Today I updated Android SDK components to the newest version and somehow the whole com.google.android.gms package is gone. Instead, there is only com.google.android.maps with different classes than those in gms package. Is it a big change form Google or have I done something wrong? I have been using GoogleMap and LatLng classes to work with google maps and now I have just errors in my project.
Is it a big change form Google or have I done something wrong?
com.google.android.gms comes from the Play Services SDK, which you attach to your application project as an Android library project. Please check your environment to ensure that you have a valid copy of the Play Services library project and that your application project still points to it.
First off, if you did not run any updates with Android SDK Manager make sure the google-play-services-lib' project is open in eclipse. If this doesn't fix your problem then proceed. Note: eclipse(v22.0.1-685705) will close google-play-services-lib project with a 'close unrelated projects' command. The google-play-services-lib project must be open.
I figured this problem out. Initially, you/I installed Google Play services in eclipse directly from the SDK Path, (SDK Path is displayed on the top left of Android SDK Manager). When you updated Google Play services with the Android SDK Manager it deleted the .project file and now eclipse can't find the 'google-play-services-lib' project and your development project fails to compile. :-(
Solution:
The basic ideal of this solution is to clean out the old 'google-play-services-lib' project in eclipse, which is now defunct and install a new one with the project copied from the SDK path.
Delete the old project:
In eclipse delete any 'google-play-services-lib' project. (In Eclipse see: Project properties-> Android -> Library.)
In In Eclipse see: Project properties-> Android -> Library delete the old entry for 'google-play-services-lib' project. This will most likely have an red 'X' on it.
Install a new one:
Follow the instruction from Google to install 'google-play-services-lib' project. These instruction specify to copy the project out of the SDK install folder; and then how to set up the projects.
http://developer.android.com/google/play-services/setup.html
Notes:
Your name for 'google-play-services-lib' may be different.
The key to remember is that Google play services is not a jar file. It is a project in eclipse. Your, development project references the google-play-services-lib project.
By copying the project folder from the SDK path to another location, this will keep the Android SDK Manager from deleting your eclipse .project file, and causing this problem. The draw back is if you would like to update google play services, you have to remember to do all the steps again.
You will need Google Play Services sdk. You can install it from Android SDK Manager, if you are using sdk for eclipse.
After installing Google Play services, you can import the library project in your Workspace from ..\sdk\extras\google\google_play_services folder. Clean and build it.
Now you can go to the properties of project having problem and select the library project in Android section.
This should work!
Currently library is in Google Repository. To enable it make sure you have downloaded it using Android SDK Manager (down to the very bottom of the list).
For android create project [...] ant CLI-based project
Similar to: How to correctly include the support library in non-Eclipse Android application
The best I could find was https://stackoverflow.com/a/30689979/895245:
copy paste android-sdk/extras/google/google_play_services/libproject/google-play-services_lib directory in the project directory
cd into it and run android update project -p . -t android-22
add <property name="android.library.reference.1" value="./google-play-services_lib"/> to your build.xml.
You can install extras with the android GUI tool, or with this CLI method: Downloading the Android support library from command line
If you just copy paste the .jar in <sdk>/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar under the libs/ directory of the project, it compiles but breaks at runtime because of the required res/values/version.xml which is not included in the .jar.
If using Android Studio you can add the Google Play Services to use the Google Android Maps v2 by adding a dependency to the build.gradle file.
dependencies {
compile 'com.google.android.gms:play-services:3.1.36'
}

Google play services library in Intellij 12

Does anyone have any experience in making use of the Google play services library project in IntelliJ?
I recently purchased IntelliJ and want to make use of the Google play services library (specifically the mapping aspects of the library). In eclipse this works no problem but in IntelliJ all of the references to MapFragment etc are not being resolved.
I have done the following:
1) Imported the Google play module as a library project (marked it as a library project in the android facet)
2) Marked the google play library project as a dependency of my main application
Despite this it's not resolving the required imports.
Does anyone have any tips for how to enable the Google play services library in an IntelliJ android project?
http://youtrack.jetbrains.com/issue/IDEA-96525
Found the solution for folks out there.
You will need to add a dummy class to the src folder.
You'll also need to add the google-play-services.jar to your module as a jar dependency.
I tried a lot of suggestions on stackoverflow.com. However, I was able to get the project to build and run in IntelliJ IDEA 12.0.2 by
Copying the google-play-services.jar file located within my android sdk directory to the ./libs directory in my Android project
Re-importing the project (e.g., on Mac OS X, open IDEA and go to File -> Import Project...) into IntelliJ IDEA.
Follow the steps in the wizard carefully. You should be able to see that IntelliJ IDEA recognizes the google-play-services.jar archive (it's checked). This worked for me. The problem appears to be a bug.
The confusion here is that you need to add the google play libs as an android library project, not the JAR. You also need to make sure import a copy of the the library project, not directly out of the android sdk folder.
In your IntelliJ Project, open the Android SDK Manager in the tools/Android menu.
Scroll to the bottom of the SDK Manager and choose to install the google play sdk.
Go to the extras folder in your android sdk directory and copy google-play-services_lib folder to somewhere handy for you
Open your module settings F4, right click your module and select to add a module. Follow the guide for adding a module from existing sources.
This way, you've added the google play android library project to your project, not just the jar.
So the way to do this is to build goole-play-services.jar from IDEA and then include the jar file as a dependency.

Facebook SDK for Android duplicate support library on dependencies

I have implemented the new Facebook SDK 3.0 beta. The library project contains the Android support library v4. I also have the support library on my own proyect (a different version though). When I add the Facebook SDK as a library I get the next error on the console:
Jar mismatch! Fix your dependencies
Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
All versions of the libraries must be the same at this time.
I've tried to exclude the libs folder on the buildpath, but the error remains.
I have to put the same .jar in both places. Am I missing something here? The idea is to use the support library of my own project (to keep it updated).
It seems like the different projects are using two separate support libraries and therefore the checksum is different.
You must repeat this for both the Facebook SDK project and the app you are building.
What I do when I get this error is:
Right click the project.
Hover over Android Tools.
Click on "Add support library..."
Accept the downloading of the library.
This insures two things: a. you get the newest version of the support library from the Google sources, and b. you have the EXACT same library in all your projects.
Happy coding!
Simply delete the one in your project, remove it from the class path and try rebuild your project.
Installing the same version of support libraries via menus mentioned in the top answer is quite a good solution.
Although this sometimes didn't work for me (I think it has something to do with my Workspace folder being synced with Dropbox, so Eclipse won't overwrite files sometimes) so the approach I am using is to link the support library from the central place.
There are these JAR files inside your SDK folder (C:\Program Files (x86)\Android\android-sdk\extras\android\ on Windows for example) which is being updated when you run SDK manager, so you could just reference that one from both the Facebook (or any other library) and your projects. Since in the end, code from JAR files gets packed to your classes.dex. You don't even need the support library in the libs folder.
Also: If you use the Gradle build system and its dependency management or even Maven you will not have problems like these, but they require more time and knowledge to set-up correctly.

Categories

Resources