[Solved] Android build failed with Google Play Services

I have a problem with compiling for android. Did not find any information about this issue

  • android-ndk-r13b

  • gradle 3.3

  • cocos creator 1.6.2

    FAILURE: Build failed with an exception.

      * What went wrong:
      A problem occurred configuring project ':gps'.
      > Failed to notify project evaluation listener.
         > Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
    
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
    
      BUILD FAILED
    
      Total time: 1.904 secs
      Stopped 0 worker daemon(s).
      Received result Failure[value=org.gradle.initialization.ReportedException: 
      org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':gps'.] from daemon 
      DaemonInfo{pid=76480, address=[266057ba-b137-4f1b-8f8a-81d80f17762d port:54433, addresses:[/0:0:0:0:0:0:0:1, 
      /127.0.0.1]], state=Idle, lastBusy=1508763333722, context=DefaultDaemonContext[uid=b2f15abf-79a1-4419-8d16-
      bf07d815366f,javaHome=/Library/Java/JavaVirtualMachines/jdk-
    

    9.jdk/Contents/Home,daemonRegistryDir=/Users/dkokorev/.gradle/daemon,pid=76480,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=BY,-Duser.language=en,-Duser.variant]} (build should be done).

i have solved this problem. found 2 versions of jdk on my mac, have deleted one

Great ! U kill a bug.

Which one of the JDK is causing the problem?

i guess that was a proplem with jdk 7, it is inside android studio, i have installed jdk 8 and it helped