Hi I know this question asked a lot but none of them help me to fix my problem.
I simply want to import this Project to my android Studio but I give this error message
Error:(15, 39) error: package com.google.android.maps does not exist
and this is my SDK:
I try clean , rebuild , invalidate cache but none of them help me.
osmdroid contributor here.
osmdroid-android, which is the primary map engine does not require google play services.
osmdroid-thirdparty does need since it provides a wrapper for using gmaps with osmdroid apis
if you're building for source: osmdroid can be built with maven (which currently has issue with play services) and gradle. suggest you use gradle with android studio
otherwise use this
dependencies {
compile 'org.osmdroid:osmdroid-thirdparty:5.0.1#aar'
}
I dont think osmdroid does need googlemaps library. But anyway, have you tried adding google-play-services library to build.gradle?
If you havent you can do this by following steps
Click on Project Structure
Go to Dependencies Tab
Click + button
Select com.google.android.gms:play-services and click ok
Rebuild the project
Related
I'm trying to integrate a Unity project into an already existing Android Studio project. I get this error when I try to run the application:
Program type already present: com.unity3d.player.BuildConfig
I had this issue when I had Unity Monetization 3.0.1 (for ads) imported along with the "Build in extension enabled" please refer to the pic.
To resolve the issue
-I disabled the "built-in Ads extension"
- delete the android and ios folders in the plugin folder and
- reimport the monetization package to make it work.
There is a conflict between the built in package and the one we download from the asset store. Hope this helps someone.
I had a similar issue. My project had a library module which had the same package name as the app module. This was creating the conflict. After I change the library name in the AndroidManifest, it compiled.
Check if you have imported two modules with same package name
usually it can happen if you have libraries that use different versions of a gradle dependency.
I had the same issue.
I solve the issue by removing unity ads package from package manager.
edit: In my case monetization plugin and package manager's Unity Ads extension was conflicting. hope it helps
I've this popular problem developing an android application with Eclipse:
error: Error: No resource found that matches the given name (at 'value' with value '#integer/
google_play_services_version').
So I've tried to import the google play library as specified here but I've this error:
Invalid project description.
C:\Users\Max\workspaceAndroid\google-play-services_lib overlaps the location of another project: 'google-play-services_lib'
Infact if I try to manage the libraries of the project I get this:
It seems that the google play libraries are already imported and I can't add new library.
The last chance I think I've is to add manually the string
compile 'com.google.android.gms:play-services:4.4.2#aar'
to my build.grade as specified in this answer but I don't know where find the file or if this will solve my problem.
How can I fix the error? Thanks!
Have you had the Google Play services installed already via the Google SDK Manager?
It looks like the following for me:
Here's what i did in the whole setup, to use the Google Maps Android V2 api
Google Maps API setup, Android V2 API
I had the same issue and was able to solve it by
Importing the google play services as an android project in eclipse
Adding reference to this imported project as a 'Lib' in
README.txt under google-play-services-lib reads like this;
Library Project including Google Play services client jar.
This can be used by an Android project to use the API's provided
by Google Play services.
There is technically no source, but the src folder is necessary to ensure that the build system works. >The content is actually located in the libs/ directory.
USAGE:
Make sure you import this Android library project into your IDE and set this project as a dependency.
Note that if you use proguard, you will want to include the options from proguard.txt in your configuration.
My app crashes when I try to use libraries (like Google Analytics or others).
I've searched on Google and found some help but it still doesn't work...
My lib folder is called "libs", I've got jar in the build path...
Have you got any ideas?
The error is :
java.lang.NoClassDefFoundError: com.google.analytics.tracking.android.EasyTracker
EDIT :
Here my conf :
Thanks.
If you're using Eclipse, try this
Select your Project with the Mouse
Right click->Properties
Select Android
Verify that you've selected the "Google APIs" version that you need for your project
At the bottom, your Libraries should also appear. If they don't
Click the Add button. Add the missing libraries. Careful, though, your libraries need to use compatible APIs to your main project.
My code works perfectly on eclipse. I have created a new project on Android Studio and added my classes, I have also followed this popular tutorial answer How can I create an Android application in Android Studio that uses the Google Maps Api v2?
Now the code doesn't show any red flags and it detects the imports fine but when I build the project I get these errors:
Gradle: package com.google.android.gms.maps does not exist
Gradle: package com.google.android.gms.maps.model does not exist
On a side note I have attempted to import the MAPS sample project like the tutorial says and that has worked fine but I do not know why my new project gives me these errors even though I have followed the tutorial to the letter.
Any idea guys?
If you created a new project (which uses Gradle) and then followed the tutorial, it's completely wrong.
When using Gradle (which new projects do by default), you cannot use the UI to add dependencies. You need to add them manually in build.gradle.
It's a crappy solution right now and we're working to make this better.
In short words:
Run Android Studio
Create new project
Create new module of Android Library type, remember to set the package name to com.google.android.gms
Copy res, src folders and AndroidManifest.xml file from google-play-services_lib (you can find it in your SDK folder if you installed it using SDK Manager) to the appropriate folder in your library module ([Project]/[Library]/src/main)
Remove android-support-v4.jar from libs folder under your library module, live only google-play-services.jar and google-play-services.jar.properties files there.
Make sure your build.gradle file in library module contains following:
dependencies {
compile files('libs/google-play-services.jar')
}
Make sure your build.gradle for application module contains following:
dependencies {
compile files('libs/android-support-v4.jar')
compile project(':[LibraryModuleName]')
}
Make sure your settings.gradle contain following:
include ':MapStudio', ':[LibraryModuleName]'
You can grab layout and manifest settings from Google Maps API v2 tutorial
Keep in mind that android-support-v4.jar is neccessary only when you want to support Android v2
You can find more detailed description on my blog.
I have tried and failed many a tutorial on this, but finally find a simple solution that seem to work.
I just installed Android Studio 0.2.3 on my mac, and these are the steps that made me view a maps fragment on a fresh hello world project template:
1) Click the SDK manager button in the toolbar in Android Studio.
2) Under 'Extras' locate 'Google play services' and install it.
3) in your build.gradle file in your src directory, add this line to dependencies:
compile 'com.google.android.gms:play-services:3.1.36'
4) order and install your API-key following this tutorial: https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key
5) add the fragment to your layout xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
6) you should now be able to run your project on your device.
For those of you completely confused by everything going on with implementation of external libraries to gradle projects i have the easiest and most reliable solution.
Step by Step Guide: http://aetherstudios.net/pages/gradle.html
this might be a bit of work but it is the most reliable way i have found to get it done.
I am writing a MAP APP using Android Google Maps V2
But i am facing dependency problem, please see below images:
as you can see in above screen shot i am getting RedAlert Sign over Project Name
and as you can see in above screen shot getting RedCross over Android Dependencies
#ChulbulPandey
In Eclipse open Project -> Properties. Select Android on left. Check on the bottom that you have a reference to Google play services with a green checkmark. If not, click Add and add the google play services library
Path of google-play-services_lib at SDK;
\extras\google\google_play_services\libproject\google-play-services_lib
I am not sure but you can try this.
In Libraries tab remove the Google Maps V2 jar and add it again.
First, try changing project build target to something higher and then clean then build your project.
If that doesn't solve your issue then removing your external jar files linked and then import it again.
You must import google-play-services_lib library project from SDK and add a dependency to it from your project.
Path of google-play-services_lib at SDK;
\extras\google\google_play_services\libproject\google-play-services_lib
See link