ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

Not working with Android! #155

Closed otrepdila closed 6 years ago

otrepdila commented 6 years ago

I'm trying to test my ionic application as a native app on Android.

I've tried running the command below as per the ionic documentation: ionic Cordova run android

I tried it with ios and it's working perfectlyionic Cordova run ios, the simulator apper and the Admob test banner also.

But with the android, the build is failed because of that error!! this is the error that appears:


/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:27: error: package name.ratson.cordova.admob.banner does not exist

import name.ratson.cordova.admob.banner.BannerExecutor;
                                       ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:28: error: package name.ratson.cordova.admob.interstitial does not exist
import name.ratson.cordova.admob.interstitial.InterstitialExecutor;

                                             ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:29: error: package name.ratson.cordova.admob.rewardvideo does not exist
import name.ratson.cordova.admob.rewardvideo.RewardVideoExecutor;
                                            ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:44: error: cannot find symbol
    private BannerExecutor bannerExecutor = null;
            ^
  symbol:   class BannerExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:45: error: cannot find symbol

    private InterstitialExecutor interstitialExecutor = null;
            ^
  symbol:   class InterstitialExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:46: error: cannot find symbol
    private RewardVideoExecutor rewardVideoExecutor = null;
            ^
  symbol:   class RewardVideoExecutor
  location: class AdMob

/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:70: error: cannot find symbol

            bannerExecutor = new BannerExecutor(this);
                                 ^
  symbol:   class BannerExecutor
  location: class AdMob

/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:73: error: cannot find symbol
            interstitialExecutor = new InterstitialExecutor(this);

                                       ^
  symbol:   class InterstitialExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:76: error: cannot find symbol
            rewardVideoExecutor = new RewardVideoExecutor(this);
                                      ^
  symbol:   class RewardVideoExecutor
  location: class AdMob
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
9 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

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

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

BUILD FAILED in 3s
 FAILED
39 actionable tasks: 39 executed
(node:7324) UnhandledPromiseRejectionWarning: Error: /Users/macbookpro/desktop/ionic-t/t1/platforms/android/gradlew: 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.
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:27: error: package name.ratson.cordova.admob.banner does not exist
import name.ratson.cordova.admob.banner.BannerExecutor;
                                       ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:28: error: package name.ratson.cordova.admob.interstitial does not exist
import name.ratson.cordova.admob.interstitial.InterstitialExecutor;
                                             ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:29: error: package name.ratson.cordova.admob.rewardvideo does not exist
import name.ratson.cordova.admob.rewardvideo.RewardVideoExecutor;
                                            ^
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:44: error: cannot find symbol
    private BannerExecutor bannerExecutor = null;
            ^
  symbol:   class BannerExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:45: error: cannot find symbol
    private InterstitialExecutor interstitialExecutor = null;
            ^
  symbol:   class InterstitialExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:46: error: cannot find symbol
    private RewardVideoExecutor rewardVideoExecutor = null;
            ^
  symbol:   class RewardVideoExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:70: error: cannot find symbol
            bannerExecutor = new BannerExecutor(this);
                                 ^
  symbol:   class BannerExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:73: error: cannot find symbol
            interstitialExecutor = new InterstitialExecutor(this);
                                       ^
  symbol:   class InterstitialExecutor
  location: class AdMob
/Users/macbookpro/Desktop/ionic-t/t1/platforms/android/app/src/main/java/name/ratson/cordova/admob/AdMob.java:76: error: cannot find symbol
            rewardVideoExecutor = new RewardVideoExecutor(this);
                                      ^
  symbol:   class RewardVideoExecutor
  location: class AdMob
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
9 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

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

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

BUILD FAILED in 3s
    at ChildProcess.whenDone (/Users/macbookpro/desktop/ionic-t/t1/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at ChildProcess.emit (events.js:160:13)
    at maybeClose (internal/child_process.js:943:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:7324) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7324) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

[OK] Your app has been deployed.
     Did you know you can live-reload changes from your app with --livereload?
RenaudRohlinger commented 6 years ago

If you wants to use the latest version of cordova & cordova-android : cordova plugin rm cordova-plugin-admob-free --> cordova plugin add https://github.com/RenaudROHLINGER/lycwed-cordova-plugin-admob-free

Repo is fixed for the latest version. I can't PR this repo at this moment since this is a specific cordova 8.0 issue

RenaudRohlinger commented 6 years ago

Duplicate of #143

otrepdila commented 6 years ago

it's working now 💯 thank you so much 👍

piernik commented 6 years ago

not working for me:/

erperejildo commented 6 years ago

Is this other bug related? https://github.com/ratson/cordova-plugin-admob-free/issues/119

@RenaudROHLINGER why you can't do a PR? Sorry, don't get you with "can't PR this repo at this moment since this is a specific cordova 8.0 issue"

lucasr300 commented 6 years ago

So, @otrepdila , once is working for you, what Cordova and Android platform are you using? How it looks to be related a especific combination of versions, have a environment like your may be helpful.

srikanth-wgl commented 6 years ago

Fixed in PR #189 for both cordova 7 and cordova 8. Try with the latest version of the plugin (v0.15.0).

rlam3 commented 6 years ago

If I'm not using ionic framework but OnsenUI and Vue.js. How do I import admob?

erperejildo commented 6 years ago

@rlam3 you will have to find that out on those repos but I presume that installing it with npm should be ok

srikanth-wgl commented 6 years ago

No one mentioned 'package does not exist' error using plugin version 0.15.0. Closing this issue.

pcfjojo commented 5 years ago

name.ratson.cordova.admob.banner.BannerExecutor$1.run BannerExecutor.java - line 70 java.lang.NoClassDefFoundError: com.google.android.gms.internal.zzup

I get this error on android