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

Issues when build android project. #246

Closed rafaelblink closed 5 years ago

rafaelblink commented 5 years ago

Hey guys, I'm in toubles after add the admob-free. I'm using Ionic Framework 3.20.0

See errors.

UP-TO-DATE
:app:compileDebugJavaWithJavac
C:\projects\ConcursosParaiba\platforms\android\app\src\main\java\name\ratson\cordova\admob\rewardvideo\RewardVideoListener.java:90: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
1 error

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 7s
FAILED
27 actionable tasks: 1 executed, 26 up-to-date
(node:2292) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
C:\projects\ConcursosParaiba\platforms\android\app\src\main\java\name\ratson\cordova\admob\rewardvideo\RewardVideoListener.java:90: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

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 7s
    at ChildProcess.whenDone (C:\projects\ConcursosParaiba\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:2292) 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:2292) [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.
wish4129 commented 5 years ago

I'm having the same issue too

rafaelblink commented 5 years ago

@wish4129 If you remove the @Override on the line 90 from:

C:\projects\ConcursosParaiba\platforms\android\app\src\main\java\name\ratson\cordova\admob\rewardvideo\RewardVideoListener.java:

The build works fine but my ads appears only in test mode, if I remove IsTesting and set id of the admob, the ads doesn't appears, both banner, interstitial and video.

vptcnt commented 5 years ago

Same here

altick commented 5 years ago

Having the exact same issue, my ionic info:

cli packages: (C:\Users\altic\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 7.1.0 browser 5.0.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.11.2
    npm  : 6.1.0
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro
sahapr commented 5 years ago

same here

Riaz12 commented 5 years ago

Same here, is there any fix yet ?

ratson commented 5 years ago

Seems duplicate to https://github.com/ratson/cordova-plugin-admob-free/issues/244 Please check your if your are using latest admob sdk.

nilesh52 commented 5 years ago

Remove new version and install old version to resolve problem , ionic cordova plugin add cordova-plugin-admob-free@0.17.0 its work

JeanClaudeCottier commented 5 years ago

Ok, I’ve got a solution to solve this. It’s not as clean as I wanted but it works. It looks like there is a problem with older versions of google play service. It’s currently using 11.0.4 but we need something more recent. I try to update config.xml with the PLAY_SERVICES_VERSION variable but I couldn’t make it work. So, at the end, I simply edited project.properties and changed these 2 lines: 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 to those ones: cordova.system.library.1=com.google.android.gms:play-services-base:15.0.1 cordova.system.library.2=com.google.android.gms:play-services-ads:15.0.1 15.0.1 is the latest versions at the time of writing. I had to change both lines or it wouldn’t work. I don’t know what the consequences of using a more recent version. Hopefully nothing else is breaking.

rafaelblink commented 5 years ago

@JeanClaudeCottier ur project are showing the ads in production mode? setting id with ca-app-pub-xxx and isTesting = false?

ghost commented 5 years ago

Getting same Issue With Latest Verison of this plugin any fix available ?

DioNNiS commented 5 years ago

+1

JeanClaudeCottier commented 5 years ago

@rafaelblink The problem had nothing to do with production or testing setup. Yes, I'm in production and live. I'm using cordova directly not a 3rd party tool like ionic.

ghost commented 5 years ago

After deleting 90th line from code: C:\projects\ConcursosParaiba\platforms\android\app\src\main\java\name\ratson\cordova\admob\rewardvideo\RewardVideoListener.java This works for me

JeanClaudeCottier commented 5 years ago

@ajaymalik14 Good luck getting rewarded videos to work now :)

diegorribeiro commented 5 years ago

Remove cast from file src in ionic project: /plugins/cordova-plugin-admob-free/src/android/rewardvideo/RewardVideoListener.java Line: 90 @Override in last function

I removed this in the ionic plugins and also in the node_modules, then removed the android platform and added again, so far so good;

rahul-maurya1992 commented 5 years ago

@nilesh52 It worked thanks....

MSandeep111 commented 5 years ago

@nilesh52 It worked thanks....

jerlysonsantos commented 4 years ago

Ok, I’ve got a solution to solve this. It’s not as clean as I wanted but it works. It looks like there is a problem with older versions of google play service. It’s currently using 11.0.4 but we need something more recent. I try to update config.xml with the PLAY_SERVICES_VERSION variable but I couldn’t make it work. So, at the end, I simply edited project.properties and changed these 2 lines: 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 to those ones: cordova.system.library.1=com.google.android.gms:play-services-base:15.0.1 cordova.system.library.2=com.google.android.gms:play-services-ads:15.0.1 15.0.1 is the latest versions at the time of writing. I had to change both lines or it wouldn’t work. I don’t know what the consequences of using a more recent version. Hopefully nothing else is breaking.

I changed in project.properties, and works for me. thx