* What went wrong: A problem occurred evaluating project ':libcocos2dx'. > Project with [compile error] path ':gps' could not be found in project ':libcocos2dx'

* What went wrong: A problem occurred evaluating project ':libcocos2dx'. > Project with [compile error] path ':gps' could not be found in project ':libcocos2dx'
0.0 0

#1

I have problem When building with Android
" Project with path ‘:gps’ could not be found in project ‘:libcocos2dx’."

help me please

Below is a full log.

Building mode: release
Using Android Studio project : C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio
Building apk…
running: ‘“C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio\gradlew.bat” --parallel --info assembleRelease’

Initialized native services in: C:\Users\chsh.gradle\native
Found daemon DaemonInfo{pid=9924, address=[1546e602-e290-45a2-825f-99f33c20a567 port:50459, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Idle, lastBusy=1513003602920, context=DefaultDaemonContext[uid=5c9958a8-6992-4a25-9db9-279974b8cf2a,javaHome=C:\Program Files (x86)\Java\jre1.8.0_151,daemonRegistryDir=C:\Users\chsh.gradle\daemon,pid=9924,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=x-windows-949,-Duser.country=KR,-Duser.language=ko,-Duser.variant]} however its context does not match the desired criteria.
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files\Java\jdk1.8.0_151,daemonRegistryDir=C:\Users\chsh.gradle\daemon,pid=4800,idleTimeout=null,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=x-windows-949,-Duser.country=KR,-Duser.language=ko,-Duser.variant]
Actual: DefaultDaemonContext[uid=5c9958a8-6992-4a25-9db9-279974b8cf2a,javaHome=C:\Program Files (x86)\Java\jre1.8.0_151,daemonRegistryDir=C:\Users\chsh.gradle\daemon,pid=9924,idleTimeout=10800000,daemonOpts=-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=x-windows-949,-Duser.country=KR,-Duser.language=ko,-Duser.variant]

Looking for a different daemon…
The client will now receive all logging from the daemon (pid: 10784). The daemon log file: C:\Users\chsh.gradle\daemon\4.1\daemon-10784.out.log
Starting 26th build in daemon [uptime: 4 hrs 17 mins 24.368 secs, performance: 100%, no major garbage collections]
Using 4 worker leases.
Creating new cache for fileHashes, path C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio.gradle\4.1\fileHashes\fileHashes.bin, access org.gradle.cache.internal.DefaultCacheAccess@39ad894c
Creating new cache for plugin-use-metadata, path C:\Users\chsh.gradle\caches\4.1\plugin-resolution\plugin-use-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@c670df0
Creating new cache for client-status, path C:\Users\chsh.gradle\caches\4.1\plugin-resolution\client-status.bin, access org.gradle.cache.internal.DefaultCacheAccess@c670df0
Starting Build
Settings evaluated using settings file ‘C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio\settings.gradle’.
Projects loaded. Root project using build file ‘C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio\build.gradle’.
Included projects: [root project ‘proj.android-studio’, project ‘:hello_world’, project ‘:libcocos2dx’]
Parallel execution is an incubating feature.
Evaluating root project ‘proj.android-studio’ using build file ‘C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio\build.gradle’.
Creating new cache for metadata-1.1/results, path C:\Users\chsh.gradle\caches\transforms-1\metadata-1.1\results.bin, access org.gradle.cache.internal.DefaultCacheAccess@52cac369
Creating new cache for metadata-2.23/module-metadata, path C:\Users\chsh.gradle\caches\modules-2\metadata-2.23\module-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@772d671c
Creating new cache for metadata-2.23/artifact-at-repository, path C:\Users\chsh.gradle\caches\modules-2\metadata-2.23\artifact-at-repository.bin, access org.gradle.cache.internal.DefaultCacheAccess@772d671c
Evaluating project ‘:hello_world’ using build file ‘C:\Users\chsh\Desktop\sdktest\build\jsb-link\frameworks\runtime-src\proj.android-studio\app\build.gradle’.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugApk
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Configuration ‘compile’ in project ‘:hello_world’ is deprecated. Use ‘implementation’ instead.
Parsing the SDK, no caching allowed
SDK initialized in 36 ms
Using incremental javac compilation for :hello_world debug.
Using incremental javac compilation for :hello_world debugUnitTest.
Using incremental javac compilation for :hello_world release.
Using incremental javac compilation for :hello_world releaseUnitTest.
Using incremental javac compilation for :hello_world debugAndroidTest.
Evaluating project ‘:libcocos2dx’ using build file ‘C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build.gradle’.
Creating configuration androidTestUtil
Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration api
Creating configuration implementation
Creating configuration runtimeOnly
Creating configuration compileOnly
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestApi
Creating configuration androidTestImplementation
Creating configuration androidTestRuntimeOnly
Creating configuration androidTestCompileOnly
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testApi
Creating configuration testImplementation
Creating configuration testRuntimeOnly
Creating configuration testCompileOnly
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugApi
Creating configuration debugImplementation
Creating configuration debugRuntimeOnly
Creating configuration debugCompileOnly
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration androidTestDebugCompile
Creating configuration androidTestDebugPublish
Creating configuration androidTestDebugProvided
Creating configuration androidTestDebugApi
Creating configuration androidTestDebugImplementation
Creating configuration androidTestDebugRuntimeOnly
Creating configuration androidTestDebugCompileOnly
Creating configuration androidTestDebugWearApp
Creating configuration androidTestDebugAnnotationProcessor
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugApi
Creating configuration testDebugImplementation
Creating configuration testDebugRuntimeOnly
Creating configuration testDebugCompileOnly
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseApi
Creating configuration releaseImplementation
Creating configuration releaseRuntimeOnly
Creating configuration releaseCompileOnly
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseApi
Creating configuration testReleaseImplementation
Creating configuration testReleaseRuntimeOnly
Creating configuration testReleaseCompileOnly
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Parsing the SDK, no caching allowed
SDK initialized in 0 ms

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx\build.gradle’ line: 29

  • What went wrong:
    A problem occurred evaluating project ‘:libcocos2dx’.

Project with path ‘:gps’ could not be found in project ‘:libcocos2dx’.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s
Error running command, return code: 1.


#2

Ok, so I had this issue too. It’s quite simple to fix.

  1. Go to the directory below
C:\CocosCreator\resources\cocos2d-x\cocos\platform\android\libcocos2dx
  1. Then open the build.gradle file (in a text editor or in some way you could view the codes)

  2. remove line 29 eg.

BEFORE

...
dependencies {
    compile project(':gps')  //remove this line (line 29)
    compile fileTree(dir: '../java/libs', include: ['*.jar']).exclude(['android-support-v4.jar', 'android_support_v7/appcompat/libs/android-support-v4.jar'])
}

AFTER

...
dependencies {
    compile fileTree(dir: '../java/libs', include: ['*.jar']).exclude(['android-support-v4.jar', 'android_support_v7/appcompat/libs/android-support-v4.jar'])
}

Hope this was helpful. :smiley: