google maps jar file missing from android sdk - android

I am writing an android application however I am using the google maps api and when I run my code iI get the following error...
C:\android-sdk-windows\add-ons\addon-google_apis_google_inc maps.jar has no source attachment
and
E/AndroidRuntime(374): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{lbs.tutorial/lbs.tutorial.WhereAmIActivity}: java.lang.ClassNotFoundException: lbs.tutorial.WhereAmIActivity in loader dalvik.system.PathClassLoader[/data/app/lbs.tutorial-2.apk]
sure enough through windows explorer the add-ons folder is empty, cann anyone tell me how to get this jar file?
I have updated the google apis in the sdk and the adt plugin is up to date. Ive triple checked my files but im at a loss.
Thanks for looking
Peter

Make sure you're targeting the right platform in your project. For each version of Android you can select the open-source version or the Google version (which has maps etc included).
In Eclipse: Right click on your project properties --> Android --> Select project build target (making sure that you click the Google APIs version).

Related

Missing "<sdk>/extras/google/google_play_services/libproject" folder after update to revision 30

I updated the Google Play Services version from the revision 29 to 30 using the Android SDK Manager, but after updating the directory "<sdk>/extras/google/google_play_services/libproject" disappeared, leaving only the directories "docs" and " samples".
I've tried uninstall and reinstall several times but always happens to miss the directory "libproject".
Anyone had this problem with the update?
I'm using Debian Linux 8.4 (jessie) although not believe it has anything to do with the problem.
Looks like Google just broke down Google Play Services into multiple libraries. You'll find them in <sdk>/extras/google/m2repository/com/google/android/gms, if you also updated Google Repository through the SDK Manager.
The individual libraries are in aar format, so you'll have to extract the jar yourself, if that's what you're after.
I am working on a legacy project in Eclipse and I fixed the problem a slightly different way than the others. For me using the project from Google Play Services revision 29, had all sorts of dependency problems which I could not resolve. For example it wanted the compatibility library v4 so I imported it but even then it could not find some required resources.
However, I was able to use Revision 28 without such issues and set the minimum version of my app to be ICS. Below is a link to version 28. Download it, unzip it and extract the libproject folder to where it would normally have been prior to removal.
Import the project in Eclipse (ensure copy files is selected) the usual way and all will be fine.
https://dl-ssl.google.com/android/repository/google_play_services_8298000_r28.zip
For now I downgraded back to revision 29 (and worked well) using the version history available on this site: http://www.smorgasbork.com/2015/01/05/google-play-services-sdk-version-history
I believe it is possible that this is the new format that Google will provide the libs (in .aar files) up because of the description of the update:
The revision number 29 says "client library and sample code" and the revision number 30 says "javadocs and and sample code".
The m2repository folder contains aar files used for android studio. If you look at the samples folder and open some of the sample apps project.properties file you will see that the sample apps still reference the google-play-services_lib. This is for sure to be fixed by google, I saw also people complaining about display ads problem, so maybe they will come back with an update quite soon.
I posted a question about this in the Google Mobile Ads SDK Developers forum. Summarizing the steps in the answer (from Veer Busani, Mobile Ads SDK Team):
We would never recommend you to rename/edit any part of the Android SDK. If you find any issues, do let us know and we would look into it. As to your Mobile Ads/Unity/Android integration, I will certainly help you. Please follow these steps if you are on Google Play Service revision 30.0 (v 9.0) -
Make a new project and import the Mobile Ads Unity package.
Copy our demo script, make a new empty GameObject and add the script as the component.
Right click on Assets > PlayServicesResolver folder and select Google Play Services > Resolve Client Jars.
There is a known issue with GMS revision 30 in Unity. To build for Android, you would need to select Assets > Plugins > Android > firebase-common-9.0.0.aar file and in the Unity Inspector, deselect Android under the Platform for Plugins sections.
Finally, edit the Bundle Identifier in your Player Settings and deploy your awesome project to your Android device.
This worked.

Google-Play-Services Lib Project - Gone Today After SDK Update [duplicate]

I updated the Google Play Services version from the revision 29 to 30 using the Android SDK Manager, but after updating the directory "<sdk>/extras/google/google_play_services/libproject" disappeared, leaving only the directories "docs" and " samples".
I've tried uninstall and reinstall several times but always happens to miss the directory "libproject".
Anyone had this problem with the update?
I'm using Debian Linux 8.4 (jessie) although not believe it has anything to do with the problem.
Looks like Google just broke down Google Play Services into multiple libraries. You'll find them in <sdk>/extras/google/m2repository/com/google/android/gms, if you also updated Google Repository through the SDK Manager.
The individual libraries are in aar format, so you'll have to extract the jar yourself, if that's what you're after.
I am working on a legacy project in Eclipse and I fixed the problem a slightly different way than the others. For me using the project from Google Play Services revision 29, had all sorts of dependency problems which I could not resolve. For example it wanted the compatibility library v4 so I imported it but even then it could not find some required resources.
However, I was able to use Revision 28 without such issues and set the minimum version of my app to be ICS. Below is a link to version 28. Download it, unzip it and extract the libproject folder to where it would normally have been prior to removal.
Import the project in Eclipse (ensure copy files is selected) the usual way and all will be fine.
https://dl-ssl.google.com/android/repository/google_play_services_8298000_r28.zip
For now I downgraded back to revision 29 (and worked well) using the version history available on this site: http://www.smorgasbork.com/2015/01/05/google-play-services-sdk-version-history
I believe it is possible that this is the new format that Google will provide the libs (in .aar files) up because of the description of the update:
The revision number 29 says "client library and sample code" and the revision number 30 says "javadocs and and sample code".
The m2repository folder contains aar files used for android studio. If you look at the samples folder and open some of the sample apps project.properties file you will see that the sample apps still reference the google-play-services_lib. This is for sure to be fixed by google, I saw also people complaining about display ads problem, so maybe they will come back with an update quite soon.
I posted a question about this in the Google Mobile Ads SDK Developers forum. Summarizing the steps in the answer (from Veer Busani, Mobile Ads SDK Team):
We would never recommend you to rename/edit any part of the Android SDK. If you find any issues, do let us know and we would look into it. As to your Mobile Ads/Unity/Android integration, I will certainly help you. Please follow these steps if you are on Google Play Service revision 30.0 (v 9.0) -
Make a new project and import the Mobile Ads Unity package.
Copy our demo script, make a new empty GameObject and add the script as the component.
Right click on Assets > PlayServicesResolver folder and select Google Play Services > Resolve Client Jars.
There is a known issue with GMS revision 30 in Unity. To build for Android, you would need to select Assets > Plugins > Android > firebase-common-9.0.0.aar file and in the Unity Inspector, deselect Android under the Platform for Plugins sections.
Finally, edit the Bundle Identifier in your Player Settings and deploy your awesome project to your Android device.
This worked.

Unable to find package com.google.cast

I recently updated ADT to point to Google APIs 18. The install went fine it seems and I'm able to point my Project Properties to Google APIs 18, however, Eclipse can't find the package com.google.cast. Anyone else having this problem?
That's because com.google.cast is not part of Android.
Near as I can tell, you will need to download a ZIP file containing their library project, import it into your IDE, mark it as actually being a library project, then attach that library project to your app.
Actually using those APIs appears to require a whitelisting, and it is in violation of their license to actually distribute an app (or, near as I can tell, source code) without express written permission of Google.
CommonsWare is correct, additionally, you'll need the v18 Android Support Libraries. v7/mediaRouter & v7/appCompat
I finally got this to work for me. Originally, I tried doing it like I used ActionBarSherlock (making it a library, went to Project -> Properties and told it to use that library, etc) but that didn't work. Finally, I got frustrated and simply moved the GoogleCastSdkAndroid-1.0.0.jar file from the lib folder of the library directly into the lib folder of the project.
So, again, I imported from existing code the SDK into my workspace, then took the jar file from its library and put it directly into my project's lib folder. Not sure if that's how it's supposed to be, but the sample TicTacToe game is now error free and runs on my Nexus 4.
It sounds like you're trying to run one of the Google Cast sample apps without having installed the Google Cast SDK. The instructions for installing the SDK and all necessary support libraries were just uploaded here on GitHub. I'm quoting below the relevant section for installing the Cast SDK itself:
http://developer.android.com/tools/support-library/setup.html#libs-with-res
You can either add the Cast SDK as a library project in your workspace, or add
the GoogleCastSdkAndroid-x.x.x.jar directly to the project you're building. The
former is recommended if you have multiple Cast-related projects in your
workspace.
As a library project: Follow the Support Library setup instructions linked
above for your downloaded and extracted SDK.
As an included library:
Copy the /libs folder from your downloaded SDK to your Cast-related project.
In the Package Explorer window, open (your Cast project)/libs and right
click on GoogleCastSdkAndroid-x.x.x.jar. Select Build Path->Add to Build
Path.

How do I set the Java Doc for google drive api for android in Eclipse

I am using the google drive api for android in eclipse, how do I link the documentation so that when I hover over something, I can view the java doc for it.
Assuming you are using the Android Development Tools (ADT), see https://stackoverflow.com/a/11579339/1369991 on how to do it.
Note that the contents of the libs folder will be bundled with your application. So you really should put the source and Javadoc JARs in another folder or even keep them outside of your workspace. Everything described in that answer also works with external JARs -- on Windows you just have to use \\ or / instead of the usual \ as path separator.
I just found Google Plugin for Eclipse and the 3rd dot says Importing the latest Google APIs

creating android map in intellij

I'm trying to create a simple map in androi (I want to add GPS coordinates later) in intellij 9.0.1 and I installed the sdk (and android 1.1 - 2.1 sdk platform support and google api 3-7).
I created a new android project and I selected android 2.0.
Now I added to my AndroidManifest.xml like all the tutorials say, however when I run this class it isn't found.
Does anyone know wether I'm doing something wrong or where I can find this package>
I would make sure that your Android facet is setup to use the Google API's. When you configure your Android SDK from IntelliJ, you can select your build target. I suspect you've chosen just the Android build target, and not the Goolge API build target.
Look under Project Structure->Facets->Android. Make sure your Android Platform is one of the Google API's.
Thanks Steve!
Once you do what Steve says, if you don't see A Google API in the platform list, you'll have to add a new platform by..
Clicking New
Browse To: /wherever_you_stored_the_android_folder/add-ons/addon_google_apis_google_inc_X (where X is the api number you want)
Click OK
You should now be able to select the Google API.

Categories

Resources