Closed matheuscaldasrj closed 6 years ago
install lowest version of this plugin cordova plugin add cordova-plugin-admob-free@0.12.1
just try to remove the platform and add the platform again.
Install last cordova npm i cordova -g
Remove cordova android from your app ionic cordova platform rm android
Add cordova-android 6.3.0 cordova platform add android@6.3.0
Run: ionic cordova run android
This worked for me.
There was something wrong with version 0.13.0, so I tried 0.12.1 like @merbin2012 said. After removing platform and reinstalling cordova it has worked fine. Thank you all!
@azarus installing android@6.3.0 also solved my problem, Thnx bro
@azarus, @mithunnick roll back to 6.3 is not a real solution since January 23th. Unfortunately we need version 7 to display ads: https://support.google.com/admob/answer/7562314?ctx=email
I've been dealing with this for a few days :S
im facing same problem please help me... i tried @0.12.1 but same issue with admob plugin during release or debug same problem
Needless to say that today, June 2018 many of us are on Cordova 8.0.0 and android@7.0.0 (if not @7.1.0)...
$ cordova build android .... :app:transformClassesWithDesugarForDebugException in thread "main" java.lang.IllegalArgumentException at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) .... at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:584)
@RikdeBoer did you find a fix with the current versions?
`:app:transformClassesWithDesugarForDebug Exception in thread "main" java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108)`
same problem here, how to do solve? @RikdeBoer
I changed the platform/project.properties file, just replace the version number then add + sign.
Example:
Before
cordova.system.library.2=com.google.android.gms:play-services-ads:11.8.0
After
cordova.system.library.2=com.google.android.gms:play-services-ads:+
and just use this command in CLI: cordova clean android
and build again.
I hope to solve this problem for cordova-plugin-admob-free plugin.
sorry for my bad English.
Same problem here with cordova 8.0.0 and android 7.1.0 ! Any solutions so far ? Or is there an alternative to admob-free ?
@stadtrausch i posted a solution above did you see it or did you try it?
@azarus i tried every solution here without success.
What helped for me was create a new blank project, copy the src folder and reinstall every plugin of the project starting with admob-free.
@Stadtrausch come to teamviewer I will try to solve your problem. merbin2010@gmail.com
@merbin2012 Thank you very much, but like i wrote above, creating a new project and adding the plugins again solved my problem.
Not sure if it helps anyone, but I had a similar issue when installing admob free. To resolve, I followed the following steps.
1> saved my current code to repo (so I have a rollback position) //update environment cordova 2>sudo npm i cordova -g 3> ionic cordova platform rm android 4> rm -fr platforms/android www plugins 5> ionic cordova platform add android@7.1.1 5a> if you use firebase or services that require google-services.json, copy it again once the folder has been created. 6> ionic cordova build android 7> Likely to fail with error:: Execution failed for task ':app:transformClassesWithDesugarForDebug'. 7a> Unlike what was mentioned above, I made sure to specify the version. And also had the support-core-utils match my application and environment build. My environment is set to 26+, however, the project was pointing to 27., I changed it to 26 as per below. NOTE: Yours may look different than what I mentioned below, just make sure that google services follow the same version.
Example:: cordova.system.library.1=com.google.android.gms:play-services-maps:15.0.1 cordova.system.library.2=com.google.android.gms:play-services-location:15.0.1 cordova.system.library.3=com.android.support:support-core-utils:26.+ cordova.system.library.4=com.google.android.gms:play-services-base:15.0.1 cordova.system.library.5=com.google.android.gms:play-services-ads:15.0.1
Took me awhile to figure this out so hopefully it helps someone without having to rebuild your entire project :)
@Riyaz0001 Thanks this works fine thanks
@siege-nnn it's work for me Thanks
Few solutions above worked for me. I am able to build. But when I run the app in my device its crashing for the below code lines: admob.interstitial.prepare(); admob.interstitial.show();
Please help.
@arijitnaskar : this code is work for me test it in your .ts file constructor(public navCtrl: NavController, public navParams: NavParams, private admob: AdMobPro, private platform: Platform) {
platform.ready().then(() => {
var admobid = {
banner: '',
interstitial: ''
};
this.admob.createBanner({
adId: admobid.banner,
isTesting: true,
autoShow: true,
position: this.admob.AD_POSITION.BOTTOM_CENTER
})
this.admob.prepareInterstitial({
adId: admobid.interstitial,
isTesting: true,
autoShow: false
})
});
}
showInterstitialAd() {
if (AdMobPro) {
this.admob.showInterstitial();
}
}
@LAHHCEN7 Thanks. But mine is not a code issue. what I figured out is the plugin cordova-plugin-admob-free
is conflicting with the plugin cordova-plugin-play-games-services
.
By doing cordova.system.library.2=com.google.android.gms:play-services-ads:+
I managed to build. But the app is crashing.
Still not able to find a solution. :(
I solved the issue.
initially after installing both the plugin my project.properties was like below:
cordova.system.library.1=com.google.android.gms:play-services-base:11.0.4
cordova.system.library.2=com.google.android.gms:play-services-ads:11.0.4
cordova.system.library.3=com.google.android.gms:play-services-games:+
cordova.system.library.4=com.google.android.gms:play-services-plus:+
It was throwing error while building. Then I changed like below as suggested in above comments.
cordova.system.library.1=com.google.android.gms:play-services-base:+
cordova.system.library.2=com.google.android.gms:play-services-ads:+
cordova.system.library.3=com.google.android.gms:play-services-games:+
cordova.system.library.4=com.google.android.gms:play-services-plus:+
This change allowed me to build. But the app was crashing after installation. Then I thought may be the admob plugin will not work if I use version greater that 11.0.4 So changed like below and its working.
cordova.system.library.1=com.google.android.gms:play-services-base:11.0.4
cordova.system.library.2=com.google.android.gms:play-services-ads:11.0.4
cordova.system.library.3=com.google.android.gms:play-services-games:11.0.4
cordova.system.library.4=com.google.android.gms:play-services-plus:11.0.4
Spend almost 20 hours for this simple versioning issue :( It feels frustrating when you see you have no error in your code but the environment is destroying the application. :(
** I am not using Ionic. I am using simple cordova to build. But I think this will work for Ionic build also.
@arjitnaskar don't do it will download lowest version 11.0 So follow the below line, might you will get after the build. If you get error simply run cordova clean command and run again, it should work.
cordova.system.library.1=com.google.android.gms:play-services-base:+ cordova.system.library.2=com.google.android.gms:play-services-ads:+ cordova.system.library.3=com.google.android.gms:play-services-games:+ cordova.system.library.4=com.google.android.gms:play-services-plus:+
Current latest version is 16+
@merbin2012 As I mentioned I already tried this (with cordova clean
). I am able to build. But after installing the app is crashing while launch ( error popup in device: Unfortunately .... has stopped working
)
Is there any problem if I use version 11.0 ? I tested with android 5 (Samsung), android 6 (Motorola).
and its working.
I did a alpha release in google play store. Till now not faced any problem.
@arijitnaskar What is your cordova version?
@merbin2012 I am using cordova 8. Edit: Just now I changed all the versions from 11.0 to 15.0.1 and its working. Seems like the "+" for all is not working because I thing it is taking different versions for different libraries.
I solved the issue.
initially after installing both the plugin my project.properties was like below:
cordova.system.library.1=com.google.android.gms:play-services-base:11.0.4 cordova.system.library.2=com.google.android.gms:play-services-ads:11.0.4 cordova.system.library.3=com.google.android.gms:play-services-games:+ cordova.system.library.4=com.google.android.gms:play-services-plus:+
It was throwing error while building. Then I changed like below as suggested in above comments.
cordova.system.library.1=com.google.android.gms:play-services-base:+ cordova.system.library.2=com.google.android.gms:play-services-ads:+ cordova.system.library.3=com.google.android.gms:play-services-games:+ cordova.system.library.4=com.google.android.gms:play-services-plus:+
This change allowed me to build. But the app was crashing after installation. Then I thought may be the admob plugin will not work if I use version greater that 11.0.4 So changed like below and its working.
cordova.system.library.1=com.google.android.gms:play-services-base:11.0.4 cordova.system.library.2=com.google.android.gms:play-services-ads:11.0.4 cordova.system.library.3=com.google.android.gms:play-services-games:11.0.4 cordova.system.library.4=com.google.android.gms:play-services-plus:11.0.4
Spend almost 20 hours for this simple versioning issue :( It feels frustrating when you see you have no error in your code but the environment is destroying the application. :(
** I am not using Ionic. I am using simple cordova to build. But I think this will work for Ionic build also.
Thanks man, this one worked for me aswell, you saved my ass, cheers!
My issue occurred after updating the google Admob SDK. I found that the app would crash with "Unfortunately AppName has stopped unexpectedly" if I did the following.
ionic start AppName blank --type ionic-angular
ionic cordova platform add android
ionic cordova plugin add cordova-plugin-admobpro
OR
ionic cordova plugin add cordova-plugin-admob-free
ionic cordova run android
I got the stack trace off the device by using
~/Android/Sdk/platform-tools/adb logcat
and found the following error message:
I hope this helps somebody because I wasted days chasing different versions around trying to find the cause.
good morning, I have problems with the plugin cordova-plugin-admobpro when I compile my project and generate the apk for android generates it well. but when I install the apk in my cellphone to application does not load the program is closed.
This was working fine until last week as this plugin used it in several apps.
Follow the instructions, you need to load additional package in Android SDK. Had the same problem but now resolved.
It's a screenshot on the readme.
Hope this helps you.
On Thu, 11 Oct 2018 at 18:36, dalejomen notifications@github.com wrote:
good morning, I have problems with the plugin cordova-plugin-admobpro when I compile my project and generate the apk for android generates it well. but when I install the apk in my cellphone to application does not load the program is closed.
This was working fine until last week as this plugin used it in several apps.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ratson/cordova-plugin-admob-free/issues/141#issuecomment-429048658, or mute the thread https://github.com/notifications/unsubscribe-auth/AAyTIvFL_V-0KF_cMeUVzLsy7FfbHsfAks5uj4GSgaJpZM4RN6Sj .
--
Burim Gosalci
I did not understand the solution
Follow the instructions, you need to load additional package in Android SDK. Had the same problem but now resolved. It's a screenshot on the readme. Hope this helps you. On Thu, 11 Oct 2018 at 18:36, dalejomen @.***> wrote: good morning, I have problems with the plugin cordova-plugin-admobpro when I compile my project and generate the apk for android generates it well. but when I install the apk in my cellphone to application does not load the program is closed. This was working fine until last week as this plugin used it in several apps. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#141 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAyTIvFL_V-0KF_cMeUVzLsy7FfbHsfAks5uj4GSgaJpZM4RN6Sj . -- Burim Gosalci
Where is the solution? PLease post here.
Hi everyone, my project was working fine untill I add cordova-plugin-admob-free.
When I try to run
ionic serve
the app starts on browser normallybut when I try running in a real device
ionic cordova run android
to test admob I get the following error:What went wrong: Execution failed for task ':transformClassesWithDexForDebug'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Total time: 32.323 secs (node:16892) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':transformClassesWithDexForDebug'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Picked up _JAVA_OPTIONS: -Xmx512M
My plugins defined in package.json are:
And my dependencies are:
Am I doing something wrong?