Admob require SDK Build Tools 22.0.1

Hi!
A new empty cpp project does not compile after adding admob with error:

cocos compile -p android --ap android-15 --android-studio

* What went wrong:
A problem occurred configuring project ':empty'.
> Could not resolve all dependencies for configuration ':empty:_debugApk'.
   > A problem occurred configuring project ':libcocos2dx'.
      > Could not resolve all dependencies for configuration ':libcocos2dx:_debugPublish'.
         > A problem occurred configuring project ':gps'.
            > The SDK Build Tools revision (22.0.1) is too low for project ':gps'. Minimum required is 25.0.0

Cocos2d-x from git (branch v3)
SDKbox admob v2.3.12.5
Android studio - latest.

What am I doing wrong?

Sorry, I’m stupid. Forgot to switch the tag to 3.14.1

Nice catch, we’ll make sure to test the installer with the next cocos2d-x release.

1 Like

Hmm.
On cocos v3.15

% cocos new test -lcpp && cd ./test && sdkbox import admob
> Copy template into /home/opt/cocos2d-x/projects/test
> Copying Cocos2d-x files...
> Rename project name from 'HelloCpp' to 'test'
> Replace the project name from 'HelloCpp' to 'test'
> Replace the project package name from 'org.cocos2dx.hellocpp' to 'org.cocos2dx.test'
> Replace the Mac bundle id from 'org.cocos2dx.hellocpp' to 'org.cocos2dx.test'
> Replace the iOS bundle id from 'org.cocos2dx.hellocpp' to 'org.cocos2dx.test'
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2016 SDKBOX Inc. v1.0.1.22
 test speed of hosts...
 - test host main: 50.85KB/s.
 - test host china: 50.79KB/s.
 choose the fastest server 'main', speed is 50.85KB/s.
 Installation Successful :)
 Please reference the online documentation to finish the integration:
http://sdkbox-doc.github.io/en/plugins/admob/v3-cpp/
 Installation Successful :)


% cocos compile -p android --android-studio
Building mode: debug
Using Android Studio project : /home/opt/cocos2d-x/projects/test/proj.android-studio
Building apk...
running: '"/home/opt/cocos2d-x/projects/test/proj.android-studio/gradlew" --parallel --info assembleDebug -PPROP_NDK_MODE=debug'

Initialized native services in: /home/teplik/.gradle/native
Found daemon DaemonInfo{pid=12979, address=[84d4a644-b6b1-4e41-9d03-399aadf28479 port:41525, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1490689642952, context=DefaultDaemonContext[uid=8c007645-55f9-45a9-be7d-4770f6d6baad,javaHome=/home/opt/android-studio/jre,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=12979,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]} however its context does not match the desired criteria.
Java home is different.
Wanted: DefaultDaemonContext[uid=null,javaHome=/opt/oracle-jdk-bin-1.8.0.121,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=30548,idleTimeout=null,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
Actual: DefaultDaemonContext[uid=8c007645-55f9-45a9-be7d-4770f6d6baad,javaHome=/home/opt/android-studio/jre,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=12979,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]

  Looking for a different daemon...
Connected to daemon DaemonInfo{pid=16919, address=[2f33a7e3-7059-4c54-8157-bd733fdc4162 port:40651, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1493722184627, context=DefaultDaemonContext[uid=f5dacf10-ccfa-4bcf-ae57-71d0d76900ce,javaHome=/opt/oracle-jdk-bin-1.8.0.121,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=16919,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]}. Dispatching request Build{id=d746ac5d-7c93-4207-b62e-c1a603b6f836.1, currentDir=/home/opt/cocos2d-x/projects/test/proj.android-studio}.
Received result org.gradle.launcher.daemon.protocol.BuildStarted@82ea68c from daemon DaemonInfo{pid=16919, address=[2f33a7e3-7059-4c54-8157-bd733fdc4162 port:40651, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1493722184627, context=DefaultDaemonContext[uid=f5dacf10-ccfa-4bcf-ae57-71d0d76900ce,javaHome=/opt/oracle-jdk-bin-1.8.0.121,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=16919,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]} (build should be starting).
The client will now receive all logging from the daemon (pid: 16919). The daemon log file: /home/teplik/.gradle/daemon/3.3/daemon-16919.out.log
Starting 23rd build in daemon [uptime: 1 hrs 18 mins 9.571 secs, performance: 100%, no major garbage collections]
Executing build with daemon context: DefaultDaemonContext[uid=f5dacf10-ccfa-4bcf-ae57-71d0d76900ce,javaHome=/opt/oracle-jdk-bin-1.8.0.121,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=16919,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
Creating new cache for plugin-use-metadata, path /home/teplik/.gradle/caches/3.3/plugin-resolution/plugin-use-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@3990bf3d
Creating new cache for client-status, path /home/teplik/.gradle/caches/3.3/plugin-resolution/client-status.bin, access org.gradle.cache.internal.DefaultCacheAccess@3990bf3d
Starting Build
Compiling settings file '/home/opt/cocos2d-x/projects/test/proj.android-studio/settings.gradle' using SubsetScriptTransformer.
Compiling settings file '/home/opt/cocos2d-x/projects/test/proj.android-studio/settings.gradle' using BuildScriptTransformer.
Settings evaluated using settings file '/home/opt/cocos2d-x/projects/test/proj.android-studio/settings.gradle'.
Projects loaded. Root project using build file '/home/opt/cocos2d-x/projects/test/proj.android-studio/build.gradle'.
Included projects: [root project 'proj.android-studio', project ':gps', project ':libcocos2dx', project ':test']
Parallel execution is an incubating feature.
Evaluating root project 'proj.android-studio' using build file '/home/opt/cocos2d-x/projects/test/proj.android-studio/build.gradle'.
Creating new cache for metadata-2.23/module-metadata, path /home/teplik/.gradle/caches/modules-2/metadata-2.23/module-metadata.bin, access org.gradle.cache.internal.DefaultCacheAccess@5f6e42a1
Creating new cache for metadata-2.23/artifact-at-repository, path /home/teplik/.gradle/caches/modules-2/metadata-2.23/artifact-at-repository.bin, access org.gradle.cache.internal.DefaultCacheAccess@5f6e42a1
Evaluating project ':gps' using build file '/home/opt/cocos2d-x/projects/test/cocos2d/cocos/platform/android/java/libs/gps/build.gradle'.
Using 2 worker leases.
Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration jackPlugin
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration androidTestJackPlugin
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration testJackPlugin
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration debugJackPlugin
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration testDebugJackPlugin
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration releaseJackPlugin
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Creating configuration testReleaseJackPlugin
Parsing the SDK, no caching allowed

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':gps'.
> The SDK Build Tools revision (22.0.1) is too low for project ':gps'. Minimum required is 25.0.0

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

BUILD FAILED

Total time: 2.089 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=16919, address=[2f33a7e3-7059-4c54-8157-bd733fdc4162 port:40651, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1493722184627, context=DefaultDaemonContext[uid=f5dacf10-ccfa-4bcf-ae57-71d0d76900ce,javaHome=/opt/oracle-jdk-bin-1.8.0.121,daemonRegistryDir=/home/teplik/.gradle/daemon,pid=16919,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]} (build should be done).
Error running command, return code: 1.

Working after edit ./cocos2d/cocos/platform/android/java/libs/gps/build.gradle and replace

buildToolsVersion "22.0.1"

to

buildToolsVersion "25.0.0"

PS: And the old bug with case-sensitivity in string #include “pluginadmob/PluginAdMob.h”

1 Like