intellij idea - Adding GooglePlay to Android Studio causes compile failure -


i have hello world type app compiles fine in android studio. want bring in google maps it. add support android studio , try compile gives me error.

here did after creating sample project , seeing built fine.

file-project structure->sdks. have classpath highlighted click plus. after dialog appears , select this: c:\androidrelated\android_sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar

i go , select build->rebuild project. @ point well. add line:

import com.google.android.gms.maps.googlemap;

i rebuild , time this:

gradle: failure: build failed exception.

  • what went wrong: execution failed task ':showgooglemaps:compiledebug'.

    compilation failed; see compiler error output details.

  • try: run --stacktrace option stack trace. run --info or --debug option more log output.

what going on here?

i've tried closing project, reopening it, closing android studio , starting again, etc.

really want android studio too!

thanks.

i think issue here doing import of project ide, doing builds via gradle. let's try using gradle based dependency management instead.

try instead:

  1. open sdk manager
  2. under "extras", select "android support repository" , "google repository". install them. see screenshot. enter image description here

(you may need remove play services library project.)

in dependencies section of build.gradle file, add variation of these:

compile 'com.android.support:support-v4:13.0.0' compile 'com.google.android.gms:play-services:3.1.36' 

you may need remove:

compile files('libs/android-support-v4.jar') 

now "gradlew clean" command line , try again. you'll find out what's going o --debug option if still having problems, should build. i'm not using maps project, using play services authentication. here's project using youtube apis work flow. know fact project works, can use baseline see if you've set environment correctly.

note that, depending on platform, may need restart ide after adding new dependencies. android studio still in access, it's raw around edges. i've heard folks "sync gradle project" button works them, had issues when tried using it.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -