How to: Export app with Admob Ads via Adobe Phonegap Build

Discussion and feedback on Construct 2

Post » Mon Aug 21, 2017 8:29 pm

Adobe's phonegap service, is like cocoon.io but you get one app free without any kind of splash screen to pay to remove.

additionally its only $9.99 a month if you want up to 25 apps

1) Josek5494's Free C2 Admob Plugin - http://tinyurl.com/h6phjon

Install the plugin, and in your app, use the associated plugin actions to load/display your ads when you choose to in your game. (Tip: Load the add at the beginning of your app to prevent app chugging, but then use the "display ad" action to make it visible at the appropriate time. This prevents any buffering from happing mid gameplay etc.

In the plugin properties on the left hand side bar you can enter your admob ad units. Below is the TEST ones by google you can use until you are ready to launch your game with your own ad units (made in the admob webpage)

Also, turn off "test" mode before you launch your final game.

Google's "Test Ad Units"
Banner ca-app-pub-3940256099942544/6300978111
Interstitial ca-app-pub-3940256099942544/1033173712

2) Export your app in C2 using the "Cordova Export"

Open the created config.xml file and add this line:
(It should be in the folder with the rest of the exported app files, but if not check in your construct installation directory eg: c:\program files(x86)\construct2

<plugin name="cordova-plugin-admob-free" />

(above the section that says <engine name="ios" /> < engine = name="android" />


this allows the plugin to work correctly.

3) Use the adobe phonegap build service to build your APK.

You should see cordova-plugin-admob-free listed in your "plugins tab" of your app.

Voila! Try out your apk on your device, or in an emulator like bluestacks. Works like a charm!
B
92
S
44
G
17
Posts: 1,012
Reputation: 18,607

Post » Sun Nov 19, 2017 6:39 am

Thank you for this great plugin!

Recently I am using CocoonAds with SMART display feature. Is there any feature like that in this one? :)
B
42
S
12
G
3
Posts: 40
Reputation: 3,966

Post » Mon Dec 11, 2017 4:37 pm

Hi @justifun!

Great tutorial!
Unfortunately, I tried to build my project to adobe phonegap.
I found it didn't works

Build Date: 2017-12-11 16:31:04 +0000
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
Fetching plugin "cordova-plugin-crosswalk-webview" via npm
Installing "cordova-plugin-crosswalk-webview" at "2.3.0" for android
Subproject Path: CordovaLib

After much discussion and analysis of the market, we have decided to discontinue support for Android 4.0 (ICS) in Crosswalk starting with version 20.

So the minSdkVersion of Cordova project is configured to 16 by default.
Fetching plugin "cordova-plugin-wkwebview-engine" via npm
Installing "cordova-plugin-wkwebview-engine" at "1.1.4" for android
Fetching plugin "cordova-plugin-file" via npm
Installing "cordova-plugin-file" at "5.0.0" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 6.1.2, failed version requirement: >=6.3.0
Skipping 'cordova-plugin-file' for android
Fetching plugin "cordova-plugin-httpd" via npm
Installing "cordova-plugin-httpd" at "0.9.3" for android
Fetching plugin "[email protected]^1.3.3" via npm
Installing "cordova-plugin-whitelist" at "1.3.3" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Fetching plugin "[email protected]~0.13.0" via npm
Installing "cordova-plugin-admob-free" at "0.13.0" for android
Fetching plugin "[email protected]~0.0.2" via npm
Installing "cordova-promise-polyfill" at "0.0.2" for android
Fetching plugin "[email protected]~0.13.1" via npm
Installing "cordova-admob-sdk" at "0.13.1" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 6.1.2, failed version requirement: >=6.3.0
Skipping 'cordova-admob-sdk' for android
--------------------------------------------------------------------------------
COMPILE OUTPUT
--------------------------------------------------------------------------------
Subproject Path: CordovaLib
Configuration on demand is an incubating feature.
null
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_4kifun96swd4hwf8orvy3kd68.run(/project/build.gradle:138)
org.xwalk:xwalk_core_library:23+
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
The ProjectDependency.getProjectConfiguration() method has been deprecated and is scheduled to be removed in Gradle 4.0.
ModuleDependency.getConfiguration() has been deprecated and is scheduled to be removed in Gradle 4.0. Use ModuleDependency.getTargetConfiguration() instead.
:preBuild UP-TO-DATE
:preArmv7DebugBuild UP-TO-DATE
:checkArmv7DebugManifest
:preArmv7ReleaseBuild UP-TO-DATE
:preX86DebugBuild UP-TO-DATE
:preX86ReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareOrgXwalkXwalk_core_library23535894Library
:prepareProjectCordovaLibUnspecifiedDebugLibrary
:prepareArmv7DebugDependencies
:compileArmv7DebugAidl
:compileArmv7DebugRenderscript
:generateArmv7DebugBuildConfig
:mergeArmv7DebugShaders
:compileArmv7DebugShaders
:generateArmv7DebugAssets
:mergeArmv7DebugAssets
:createXwalkCommandLineFileArmv7Debug
:generateArmv7DebugResValues
:generateArmv7DebugResources
:mergeArmv7DebugResources
:processArmv7DebugManifest
:processArmv7DebugResources
:generateArmv7DebugSources
:incrementalArmv7DebugJavaCompilationSafeguard
:compileArmv7DebugJavaWithJavac
:compileArmv7DebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdListener;
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:12: error: cannot find symbol
class BannerListener extends AdListener {
^
symbol: class AdListener
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdView;
^
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:3: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:26: error: cannot find symbol
private AdView adView;
^
symbol: class AdView
location: class BannerExecutor
/project/src/name/ratson/cordova/admob/AdMob.java:8: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
/project/src/name/ratson/cordova/admob/AdMob.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/AdMob.java:10: error: package com.google.android.gms.common does not exist
import com.google.android.gms.common.ConnectionResult;
^
/project/src/name/ratson/cordova/admob/AdMob.java:11: error: package com.google.android.gms.common does not exist
import com.google.android.gms.common.GoogleApiAvailability;
^
/project/src/name/ratson/cordova/admob/AdMobConfig.java:6: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdSize;
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.InterstitialAd;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:6: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:7: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:8: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.MobileAds;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:9: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardedVideoAd;
^
/project/src/name/ratson/cordova/admob/AdMob.java:151: error: cannot find symbol
public AdRequest buildAdRequest() {
^
symbol: class AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMobConfig.java:61: error: cannot find symbol
public AdSize adSize = AdSize.SMART_BANNER;
^
symbol: class AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:190: error: cannot find symbol
private static AdSize adSizeFromString(String size) {
^
symbol: class AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:20: error: cannot find symbol
private InterstitialAd interstitialAd;
^
symbol: class InterstitialAd
location: class InterstitialExecutor
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:23: error: cannot find symbol
private RewardedVideoAd rewardedVideoAd;
^
symbol: class RewardedVideoAd
location: class RewardVideoExecutor
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdListener;
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:12: error: cannot find symbol
class InterstitialListener extends AdListener {
^
symbol: class AdListener
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:5: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardItem;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:6: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardedVideoAdListener;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:13: error: cannot find symbol
class RewardVideoListener implements RewardedVideoAdListener {
^
symbol: class RewardedVideoAdListener
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:78: error: cannot find symbol
public void onRewarded(RewardItem reward) {
^
symbol: class RewardItem
location: class RewardVideoListener
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:20: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:34: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:46: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:56: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:62: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:30: error: cannot find symbol
case AdRequest.ERROR_CODE_INTERNAL_ERROR:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:33: error: cannot find symbol
case AdRequest.ERROR_CODE_INVALID_REQUEST:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:36: error: cannot find symbol
case AdRequest.ERROR_CODE_NETWORK_ERROR:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:39: error: cannot find symbol
case AdRequest.ERROR_CODE_NO_FILL:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:70: error: cannot find symbol
adView = new AdView(cordova.getActivity());
^
symbol: class AdView
/project/src/name/ratson/cordova/admob/AdMob.java:53: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable GoogleApiAvailability
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:53: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable ConnectionResult
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:152: error: package AdRequest does not exist
AdRequest.Builder builder = new AdRequest.Builder();
^
/project/src/name/ratson/cordova/admob/AdMob.java:152: error: package AdRequest does not exist
AdRequest.Builder builder = new AdRequest.Builder();
^
/project/src/name/ratson/cordova/admob/AdMob.java:154: error: cannot find symbol
builder = builder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice(getDeviceId());
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:177: error: cannot find symbol
builder = builder.addNetworkExtrasBundle(AdMobAdapter.class, bundle);
^
symbol: class AdMobAdapter
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:181: error: cannot find symbol
builder.setGender(AdRequest.GENDER_MALE);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:183: error: cannot find symbol
builder.setGender(AdRequest.GENDER_FEMALE);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:185: error: cannot find symbol
builder.setGender(AdRequest.GENDER_UNKNOWN);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:220: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable GoogleApiAvailability
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:220: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable ConnectionResult
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMobConfig.java:61: error: cannot find symbol
public AdSize adSize = AdSize.SMART_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:192: error: cannot find symbol
return AdSize.BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:194: error: cannot find symbol
return AdSize.FULL_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:196: error: cannot find symbol
return AdSize.LARGE_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:198: error: cannot find symbol
return AdSize.LEADERBOARD;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:200: error: cannot find symbol
return AdSize.MEDIUM_RECTANGLE;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:202: error: cannot find symbol
return AdSize.WIDE_SKYSCRAPER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:204: error: cannot find symbol
return AdSize.SMART_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:206: error: cannot find symbol
return AdSize.FLUID;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:208: error: cannot find symbol
return AdSize.SEARCH;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:210: error: cannot find symbol
return AdSize.FULL_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:212: error: cannot find symbol
return AdSize.MEDIUM_RECTANGLE;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:214: error: cannot find symbol
return AdSize.LEADERBOARD;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:44: error: cannot find symbol
interstitialAd = new InterstitialAd(cordova.getActivity());
^
symbol: class InterstitialAd
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:80: error: cannot find symbol
interstitialAd = new InterstitialAd(cordova.getActivity());
^
symbol: class InterstitialAd
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:47: error: cannot find symbol
rewardedVideoAd = MobileAds.getRewardedVideoAdInstance(cordova.getActivity());
^
symbol: variable MobileAds
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:56: error: cannot find symbol
AdRequest adRequest = new AdRequest.Builder()
^
symbol: class AdRequest
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:57: error: cannot find symbol
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
^
symbol: class AdMobAdapter
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:56: error: package AdRequest does not exist
AdRequest adRequest = new AdRequest.Builder()
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:86: error: cannot find symbol
if (rewardedVideoAd instanceof RewardedVideoAd) {
^
symbol: class RewardedVideoAd
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:87: error: cannot find symbol
RewardedVideoAd rvad = rewardedVideoAd;
^
symbol: class RewardedVideoAd
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:19: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:33: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:45: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:56: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:62: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:20: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:37: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:48: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:61: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:66: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:71: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:77: 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.
80 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileArmv7DebugJavaWithJavac'.
> 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.
:compileArmv7DebugJavaWithJavac FAILED

BUILD FAILED

Total time: 4.182 secs
Error: /project/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.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdListener;
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:12: error: cannot find symbol
class BannerListener extends AdListener {
^
symbol: class AdListener
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdView;
^
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:3: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:26: error: cannot find symbol
private AdView adView;
^
symbol: class AdView
location: class BannerExecutor
/project/src/name/ratson/cordova/admob/AdMob.java:8: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
/project/src/name/ratson/cordova/admob/AdMob.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/AdMob.java:10: error: package com.google.android.gms.common does not exist
import com.google.android.gms.common.ConnectionResult;
^
/project/src/name/ratson/cordova/admob/AdMob.java:11: error: package com.google.android.gms.common does not exist
import com.google.android.gms.common.GoogleApiAvailability;
^
/project/src/name/ratson/cordova/admob/AdMobConfig.java:6: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdSize;
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.InterstitialAd;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:6: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:7: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:8: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.MobileAds;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:9: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardedVideoAd;
^
/project/src/name/ratson/cordova/admob/AdMob.java:151: error: cannot find symbol
public AdRequest buildAdRequest() {
^
symbol: class AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMobConfig.java:61: error: cannot find symbol
public AdSize adSize = AdSize.SMART_BANNER;
^
symbol: class AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:190: error: cannot find symbol
private static AdSize adSizeFromString(String size) {
^
symbol: class AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:20: error: cannot find symbol
private InterstitialAd interstitialAd;
^
symbol: class InterstitialAd
location: class InterstitialExecutor
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:23: error: cannot find symbol
private RewardedVideoAd rewardedVideoAd;
^
symbol: class RewardedVideoAd
location: class RewardVideoExecutor
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:5: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdListener;
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:12: error: cannot find symbol
class InterstitialListener extends AdListener {
^
symbol: class AdListener
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:5: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardItem;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:6: error: package com.google.android.gms.ads.reward does not exist
import com.google.android.gms.ads.reward.RewardedVideoAdListener;
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:13: error: cannot find symbol
class RewardVideoListener implements RewardedVideoAdListener {
^
symbol: class RewardedVideoAdListener
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:78: error: cannot find symbol
public void onRewarded(RewardItem reward) {
^
symbol: class RewardItem
location: class RewardVideoListener
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:20: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:34: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:46: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:56: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/banner/BannerListener.java:62: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:30: error: cannot find symbol
case AdRequest.ERROR_CODE_INTERNAL_ERROR:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:33: error: cannot find symbol
case AdRequest.ERROR_CODE_INVALID_REQUEST:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:36: error: cannot find symbol
case AdRequest.ERROR_CODE_NETWORK_ERROR:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/AbstractExecutor.java:39: error: cannot find symbol
case AdRequest.ERROR_CODE_NO_FILL:
^
symbol: variable AdRequest
location: class AbstractExecutor
/project/src/name/ratson/cordova/admob/banner/BannerExecutor.java:70: error: cannot find symbol
adView = new AdView(cordova.getActivity());
^
symbol: class AdView
/project/src/name/ratson/cordova/admob/AdMob.java:53: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable GoogleApiAvailability
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:53: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable ConnectionResult
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:152: error: package AdRequest does not exist
AdRequest.Builder builder = new AdRequest.Builder();
^
/project/src/name/ratson/cordova/admob/AdMob.java:152: error: package AdRequest does not exist
AdRequest.Builder builder = new AdRequest.Builder();
^
/project/src/name/ratson/cordova/admob/AdMob.java:154: error: cannot find symbol
builder = builder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice(getDeviceId());
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:177: error: cannot find symbol
builder = builder.addNetworkExtrasBundle(AdMobAdapter.class, bundle);
^
symbol: class AdMobAdapter
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:181: error: cannot find symbol
builder.setGender(AdRequest.GENDER_MALE);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:183: error: cannot find symbol
builder.setGender(AdRequest.GENDER_FEMALE);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:185: error: cannot find symbol
builder.setGender(AdRequest.GENDER_UNKNOWN);
^
symbol: variable AdRequest
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:220: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable GoogleApiAvailability
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMob.java:220: error: cannot find symbol
isGpsAvailable = (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(cordova.getActivity()) == ConnectionResult.SUCCESS);
^
symbol: variable ConnectionResult
location: class AdMob
/project/src/name/ratson/cordova/admob/AdMobConfig.java:61: error: cannot find symbol
public AdSize adSize = AdSize.SMART_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:192: error: cannot find symbol
return AdSize.BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:194: error: cannot find symbol
return AdSize.FULL_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:196: error: cannot find symbol
return AdSize.LARGE_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:198: error: cannot find symbol
return AdSize.LEADERBOARD;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:200: error: cannot find symbol
return AdSize.MEDIUM_RECTANGLE;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:202: error: cannot find symbol
return AdSize.WIDE_SKYSCRAPER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:204: error: cannot find symbol
return AdSize.SMART_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:206: error: cannot find symbol
return AdSize.FLUID;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:208: error: cannot find symbol
return AdSize.SEARCH;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:210: error: cannot find symbol
return AdSize.FULL_BANNER;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:212: error: cannot find symbol
return AdSize.MEDIUM_RECTANGLE;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/AdMobConfig.java:214: error: cannot find symbol
return AdSize.LEADERBOARD;
^
symbol: variable AdSize
location: class AdMobConfig
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:44: error: cannot find symbol
interstitialAd = new InterstitialAd(cordova.getActivity());
^
symbol: class InterstitialAd
/project/src/name/ratson/cordova/admob/interstitial/InterstitialExecutor.java:80: error: cannot find symbol
interstitialAd = new InterstitialAd(cordova.getActivity());
^
symbol: class InterstitialAd
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:47: error: cannot find symbol
rewardedVideoAd = MobileAds.getRewardedVideoAdInstance(cordova.getActivity());
^
symbol: variable MobileAds
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:56: error: cannot find symbol
AdRequest adRequest = new AdRequest.Builder()
^
symbol: class AdRequest
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:57: error: cannot find symbol
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
^
symbol: class AdMobAdapter
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:56: error: package AdRequest does not exist
AdRequest adRequest = new AdRequest.Builder()
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:86: error: cannot find symbol
if (rewardedVideoAd instanceof RewardedVideoAd) {
^
symbol: class RewardedVideoAd
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoExecutor.java:87: error: cannot find symbol
RewardedVideoAd rvad = rewardedVideoAd;
^
symbol: class RewardedVideoAd
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:19: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:33: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:45: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:56: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/interstitial/InterstitialListener.java:62: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:20: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:37: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:48: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:61: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:66: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:71: error: method does not override or implement a method from a supertype
@Override
^
/project/src/name/ratson/cordova/admob/rewardvideo/RewardVideoListener.java:77: 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.
80 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileArmv7DebugJavaWithJavac'.
> 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.
at ChildProcess.whenDone (/project/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)


===============================================================================


Here is my full config.xml :

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.testis.jreng" version="1.0.0.0">

   <name>glass_scatter</name>
   <description>wola-wola</description>
   <author>alextro</author>

   <icon src="icon-128.png" width="128" height="128" />
   <icon src="icon-256.png" width="256" height="256" gap:role="default" />

   <preference name="permissions" value="none"/>
   <preference name="android-targetSdkVersion" value="21" />

   <feature name="http://api.phonegap.com/1.0/network"/>

   <preference name="orientation" value="default" />
   <preference name="fullscreen" value="true" />
   <gap:config-file platform="ios" parent="UIStatusBarHidden"><true/></gap:config-file>
   <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance"><false/></gap:config-file>
   
   <preference name="deployment-target" value="7.0" />
   <preference name="android-minSdkVersion" value="16" />
   <plugin name="cordova-plugin-crosswalk-webview" source="npm" />

   <plugin name="cordova-plugin-wkwebview-engine" />
   <plugin name="cordova-plugin-file" />
   <plugin name="cordova-plugin-httpd" />
   <engine name="android" spec="6.4.0" />
    <engine name="ios" spec="~4.5.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
   <plugin name="cordova-plugin-admob-free" spec="~0.13.0" />
   <access origin="*" />

   <!-- Optional splash screen image, e.g.: -->
   <!-- <gap:splash src="splash.png" width="1024" height="768" /> -->

</widget>


=================================================================================

How do you resolve this one?

Thank you very much for helps.

Warm regards,

Daksamedia
B
11
S
1
G
1
Posts: 10
Reputation: 1,006

Post » Thu Dec 21, 2017 9:44 pm

I have nothing in config file saying, <engine name="ios" /> < engine = name="android" /> where i post the line of code for admob. If you have a video of how to do it, i would appreciate if you send me a link so i can understand where its coming from and how the file is configured.
B
3
Posts: 2
Reputation: 179


Return to Construct 2 General

Who is online

Users browsing this forum: LaurenceBedford and 4 guests