Open zdd opened 5 years ago
environment info
D:\git\ionic\zhuanshuchaxun>ionic info
Ionic:
ionic (Ionic CLI) : 4.0.1 (C:\Users\SuperDong\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 7.0.0
Cordova Platforms : android 6.4.0
System:
Android SDK Tools : 26.0.2
NodeJS : v8.11.2 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10
Environment:
ANDROID_HOME : D:\android_sdk\sdk
It seems this lib is not work on Android, does anyone ever make this work on Android?
@zdd Try downgrading your cordova-android version from 6.4.0 to 6.3.0 and add the following lines to your build.gradle file.
// SUB-PROJECT DEPENDENCIES END compile "com.google.android.gms:play-services-analytics:+" compile "com.google.android.gms:play-services-base:+" compile "com.google.android.gms:play-services-ads:+" compile "com.google.gms:google-services:+" compile "com.google.android.gms:play-services-tagmanager:+"
@zdd Try downgrading your cordova-android version from 6.4.0 to 6.3.0 and add the following lines to your build.gradle file.
// SUB-PROJECT DEPENDENCIES END compile "com.google.android.gms:play-services-analytics:+" compile "com.google.android.gms:play-services-base:+" compile "com.google.android.gms:play-services-ads:+" compile "com.google.gms:google-services:+" compile "com.google.android.gms:play-services-tagmanager:+"
Thanks, but downgrade is not a good idea.
I'm facing this issue in 2019...
Using cordova-android@7.1.1
,
I already tried 7.1.4
and 8.0.0
and had the same issue
I suspect its related to #126 but I just removed Firebase and still have the same issue... :cry:
Further inspection leads me to believe its a problem in this plugin it self. as mentioned in #147 creating a new project shows this problem.
Steps to reproduce it:
ionic start myApp tabs
cd myApp/
ionic cordova plugin add cordova-plugin-admob-free --variable ADMOB_APP_ID="ID" --variable PLAY_SERVICES_VERSION="+"
ionic cordova platform add android@^7.1.1
ionic cordova run android --device
I will try a few more "combinations" ....
More debugging info:
It compiles on my other machine. I'm using a different gradle version between them:
export PATH=${PATH}:/opt/android-studio/gradle/gradle-5.2/bin
vs
export PATH=${PATH}:/opt/android-studio/gradle/gradle-4.10.1/bin
but I made them both use 5.2 and the problem still exists but my other machine can compile without erros...
Working machine environment:
Ionic:
ionic (Ionic CLI) : 4.10.2 (/home/unknown/npm/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.1.1
@angular-devkit/build-angular : 0.13.5
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.5
@ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 5 other plugins)
System:
Android SDK Tools : 26.1.1 (/home/unknown/Android/Sdk/)
NodeJS : v8.10.0 (/usr/bin/node)
npm : 6.7.0
OS : Linux 4.15
Non working machine environment:
Ionic:
ionic (Ionic CLI) : 4.11.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.1.1
@angular-devkit/build-angular : 0.13.5
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.5
@ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 7.0.1
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 5 other plugins)
System:
Android SDK Tools : 26.1.1 (/media/ntfs/android-sdk-linux)
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 6.9.0
OS : Linux 4.15
Humm :thinking: :thinking: :thinking: cordova cli seems to be the biggest difference....
Ok.
After updating cordova everything works.
npm install cordova -g
cordova -v
8.1.2 (cordova-lib@8.1.1)
If this solves the problem thumbs up this comment! Maybe it can also solve #147 ?
I solved like that
Firstly copy cordova-admob-sdk in your plugin directory of your app
Paste it to diffrent directory like that c:\plugins
remove plugin
cordova plugin rm cordova-admob-sdk --force
open plugin.xml in c:\plugins\cordova-admob-sdk
change
and save
return your app cli cordova plugin add c:\plugins\cordova-admob-sdk cordova build
Got the following error when install this plugin, I am wondering where is variable PLAY_SERVICES_VERSION defined? thanks.
error happen in code below in file 'build.grale' under forder platfroms/android. seems like gradle can't find this variable.