3

After a problem integrating admob into my cordova application, I've decided to follow the example layed out here: https://github.com/floatinghotpot/cordova-admob-pro

As I work with a windows 7, I've made the required changes, but it looks something like this:

C:\> cordova create test1 com.rjfun.test1 Test1
Creating a new cordova project.

C:\>cd test1

C:\test1>cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.rjfun.test1
        Name: Test1
        Activity: MainActivity
        Android target: android-22
Copying template files...
Android project created with cordova-android@4.0.0
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
npm http GET https://registry.npmjs.org/cordova-plugin-whitelist
npm http 304 https://registry.npmjs.org/cordova-plugin-whitelist
Installing "cordova-plugin-whitelist" for android

C:\test1>cordova plugin add cordova-plugin-admobpro
Fetching plugin "cordova-plugin-admobpro" via npm
npm http GET https://registry.npmjs.org/cordova-plugin-admobpro
npm http 200 https://registry.npmjs.org/cordova-plugin-admobpro
npm http GET https://registry.npmjs.org/cordova-plugin-admobpro/-/cordova-plugin-admobpro-2.8.3.tgz
npm http 200 https://registry.npmjs.org/cordova-plugin-admobpro/-/cordova-plugin-admobpro-2.8.3.tgz
Installing "cordova-plugin-admobpro" for android
Fetching plugin "cordova-plugin-extension" via npm
npm http GET https://registry.npmjs.org/cordova-plugin-extension
npm http 304 https://registry.npmjs.org/cordova-plugin-extension
Installing "cordova-plugin-extension" for android

C:\test1>rmdir /S www
www, Are you sure (Y/N)? y

C:\test1>copy plugins\cordova-plugin-admobpro\test\* www\
plugins\cordova-plugin-admobpro\test\admob_simple.js
plugins\cordova-plugin-admobpro\test\index.html
        2 file(s) copied.


C:\test1> cordova run android
Running command: C:\test1\platforms\android\cordova\run.bat
ANDROID_HOME=C:\Users\dell\AppData\Local\Android\android-studio\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_20
WARNING : No target specified, deploying to device '192.168.221.101:5555'.
Running: C:\test1\platforms\android\gradlew cdvBuildDebug -b C:\test1\platforms\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find any version that matches com.google.android.gms:play-service
s-ads:+.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/maven-metadata.xml
         https://repo1.maven.org/maven2/com/google/android/gms/play-services-ads/
         file:/C:/Users/dell/AppData/Local/Android/android-studio/sdk/extras/android/m2repository/com/google/android/gms/play-services-ads/maven-metadata.xml
         file:/C:/Users/dell/AppData/Local/Android/android-studio/sdk/extras/android/m2repository/com/google/android/gms/play-services-ads/
     Required by:
         :android:unspecified

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

BUILD FAILED

Total time: 1 mins 38.526 secs

C:\test1\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error code 1 for command: cmd with args: /s /c "C:\test1\platforms\android\gradlew cdvBuildDebug -b C:\test1\platforms\android\build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: C:\test1\platforms\android\cordova\run.bat: Command failed with exit code 8
You may not have the required environment or OS to run this project

I've made sure, in my SDK maneger, google play is installed (couldn't find any library called google-play-ads). Still, this app fails to compile. What can I do to solve this one? Thanks in advance Yair

GuruYaya
  • 545
  • 3
  • 16

1 Answers1

3

Please install the extra items as following:

enter image description here

Raymond Xie
  • 1,486
  • 12
  • 20
  • Not it.I already had everything you marked here installed on my computer. Just to be safe, I got everything under extra installed. Didn't help. – GuruYaya Jun 18 '15 at 05:05
  • I've discovered the error had to do with google repo after all. The install contained an error. I uninstalled and reinstalled it again. It worked – GuruYaya Jun 20 '15 at 16:36