Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with capacitor-community/admob when trying to debug project #122

Closed
sergemaunda opened this issue Jul 17, 2021 · 4 comments
Closed

Comments

@sergemaunda
Copy link

sergemaunda commented Jul 17, 2021

Hey everyone!

I have completed all the setup as per documentation but I run into this problem when I’m try to run the application on a mobile device (android).

[EDIT]

I have completed all the setup as per documentation but I run into this problem when I’m try to debug the application on a mobile device (android).

`

Task :capacitor-android:compileDebugJavaWithJavac
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:12: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.helpers.AuthorizationStatusEnum;
[capacitor] ^
[capacitor] symbol: class AuthorizationStatusEnum
[capacitor] location: package com.getcapacitor.community.admob.helpers
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:14: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.interstitial.InterstitialAdCallbackAndListeners;
[capacitor] ^
[capacitor] symbol: class InterstitialAdCallbackAndListeners
[capacitor] location: package com.getcapacitor.community.admob.interstitial
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:16: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.MobileAds;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:17: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.RequestConfiguration;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:18: error: package com.google.android.gms.ads.initialization does not exist
[capacitor] import com.google.android.gms.ads.initialization.InitializationStatus;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:19: error: package com.google.android.gms.ads.initialization does not exist
[capacitor] import com.google.android.gms.ads.initialization.OnInitializationCompleteListener;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:17: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.models.AdMobPluginError;
[capacitor] ^
[capacitor] symbol: class AdMobPluginError
[capacitor] location: package com.getcapacitor.community.admob.models
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:20: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdListener;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:21: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdRequest;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:22: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdSize;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:23: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdView;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:24: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.LoadAdError;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:25: error: package com.google.android.gms.common.util does not exist
[capacitor] import com.google.android.gms.common.util.BiConsumer;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\Executor.java:8: error: package com.google.android.gms.common.util does not exist
[capacitor] import com.google.android.gms.common.util.BiConsumer;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:11: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.models.AdMobPluginError;
[capacitor] ^
[capacitor] symbol: class AdMobPluginError
[capacitor] location: package com.getcapacitor.community.admob.models
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:14: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdRequest;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:15: error: package com.google.android.gms.ads.rewarded does not exist
[capacitor] import com.google.android.gms.ads.rewarded.RewardedAd;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:16: error: package com.google.android.gms.common.util does not exist
[capacitor] import com.google.android.gms.common.util.BiConsumer;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:10: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.models.AdMobPluginError;
[capacitor] ^
[capacitor] symbol: class AdMobPluginError
[capacitor] location: package com.getcapacitor.community.admob.models
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:13: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdRequest;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:14: error: package com.google.android.gms.ads.interstitial does not exist
[capacitor] import com.google.android.gms.ads.interstitial.InterstitialAd;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:15: error: package com.google.android.gms.common.util does not exist
[capacitor] import com.google.android.gms.common.util.BiConsumer;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:31: error: cannot find symbol
[capacitor] private AdView mAdView;
[capacitor] ^
[capacitor] symbol: class AdView
[capacitor] location: class com.getcapacitor.community.admob.banner.BannerExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\banner\BannerExecutor.java:37: error: cannot find symbol
[capacitor] BiConsumer<String, JSObject> notifyListenersFunction,
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.banner.BannerExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:5: error: cannot find symbol
[capacitor] import com.getcapacitor.community.admob.banner.BannerAdSizeEnum;
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: package com.getcapacitor.community.admob.banner
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\Executor.java:14: error: cannot find symbol
[capacitor] protected BiConsumer<String, JSObject> notifyListenersFunction;
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.models.Executor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\Executor.java:25: error: cannot find symbol
[capacitor] BiConsumer<String, JSObject> notifyListenersFunction,
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.models.Executor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:20: error: cannot find symbol
[capacitor] public static RewardedAd mRewardedAd;
[capacitor] ^
[capacitor] symbol: class RewardedAd
[capacitor] location: class com.getcapacitor.community.admob.rewarded.AdRewardExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:25: error: cannot find symbol
[capacitor] BiConsumer<String, JSObject> notifyListenersFunction,
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.rewarded.AdRewardExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:32: error: cannot find symbol
[capacitor] public void prepareRewardVideoAd(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.rewarded.AdRewardExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\rewarded\AdRewardExecutor.java:56: error: cannot find symbol
[capacitor] public void showRewardVideoAd(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.rewarded.AdRewardExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:19: error: cannot find symbol
[capacitor] public static InterstitialAd interstitialAd;
[capacitor] ^
[capacitor] symbol: class InterstitialAd
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:21: error: cannot find symbol
[capacitor] InterstitialAdCallbackAndListeners adCallbackAndListeners;
[capacitor] ^
[capacitor] symbol: class InterstitialAdCallbackAndListeners
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:26: error: cannot find symbol
[capacitor] BiConsumer<String, JSObject> notifyListenersFunction,
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:28: error: cannot find symbol
[capacitor] InterstitialAdCallbackAndListeners adCallbackAndListeners
[capacitor] ^
[capacitor] symbol: class InterstitialAdCallbackAndListeners
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:34: error: cannot find symbol
[capacitor] public void prepareInterstitial(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\interstitial\AdInterstitialExecutor.java:58: error: cannot find symbol
[capacitor] public void showInterstitial(final PluginCall call, BiConsumer<String, JSObject> notifyListenersFunction) {
[capacitor] ^
[capacitor] symbol: class BiConsumer
[capacitor] location: class com.getcapacitor.community.admob.interstitial.AdInterstitialExecutor
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:24: error: cannot find symbol
[capacitor] public final BannerAdSizeEnum adSize;
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: class com.getcapacitor.community.admob.models.AdOptions
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:80: error: cannot find symbol
[capacitor] private AdOptions(String id, boolean isTesting, String position, int margin, boolean npa, BannerAdSizeEnum adSize) {
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: class com.getcapacitor.community.admob.models.AdOptions
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:94: error: cannot find symbol
[capacitor] private static BannerAdSizeEnum adSizeStringToAdSizeEnum(String sizeString) {
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: class com.getcapacitor.community.admob.models.AdOptions
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\AdViewIdHelper.java:6: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdRequest;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\AdViewIdHelper.java:7: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdView;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\AdViewIdHelper.java:13: error: cannot find symbol
[capacitor] public static String getFinalAdId(AdOptions adOptions, AdRequest adRequest, String logTag, Context context)
{
[capacitor] ^
[capacitor] symbol: class AdRequest
[capacitor] location: class com.getcapacitor.community.admob.helpers.AdViewIdHelper
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\AdViewIdHelper.java:26: error: cannot find symbol
[capacitor] public static void assignIdToAdView(AdView adView, AdOptions adOptions, AdRequest adRequest, String logTag,
Context context) {
[capacitor] ^
[capacitor] symbol: class AdView
[capacitor] location: class com.getcapacitor.community.admob.helpers.AdViewIdHelper
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\AdViewIdHelper.java:26: error: cannot find symbol
[capacitor] public static void assignIdToAdView(AdView adView, AdOptions adOptions, AdRequest adRequest, String logTag,
Context context) {
[capacitor] ^
[capacitor] symbol: class AdRequest
[capacitor] location: class com.getcapacitor.community.admob.helpers.AdViewIdHelper
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\RequestHelper.java:5: error: package com.google.ads.mediation.admob does not exist
[capacitor] import com.google.ads.mediation.admob.AdMobAdapter;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\RequestHelper.java:6: error: package com.google.android.gms.ads does not exist
[capacitor] import com.google.android.gms.ads.AdRequest;
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\helpers\RequestHelper.java:17: error: cannot find symbol
[capacitor] public static AdRequest createRequest(AdOptions adOptions) {
[capacitor] ^
[capacitor] symbol: class AdRequest
[capacitor] location: class com.getcapacitor.community.admob.helpers.RequestHelper
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:165: error: cannot find symbol
[capacitor] private BannerAdSizeEnum adSize = BannerAdSizeEnum.ADAPTIVE_BANNER;
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: class com.getcapacitor.community.admob.models.AdOptions.TesterAdOptionsBuilder
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\community\admob\models\AdOptions.java:197: error: cannot find symbol
[capacitor] public TesterAdOptionsBuilder setAdSize(BannerAdSizeEnum value) {
[capacitor] ^
[capacitor] symbol: class BannerAdSizeEnum
[capacitor] location: class com.getcapacitor.community.admob.models.AdOptions.TesterAdOptionsBuilder
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:46: error: cannot find symbol
[capacitor] InterstitialAdCallbackAndListeners.INSTANCE
[capacitor] ^
[capacitor] symbol: variable InterstitialAdCallbackAndListeners
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:57: error: cannot find symbol
[capacitor] new OnInitializationCompleteListener() {
[capacitor] ^
[capacitor] symbol: class OnInitializationCompleteListener
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:55: error: cannot find symbol
[capacitor] MobileAds.initialize(
[capacitor] ^
[capacitor] symbol: variable MobileAds
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:72: error: package AuthorizationStatusEnum does not exist
[capacitor] response.put("status", AuthorizationStatusEnum.AUTHORIZED.getStatus());
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:137: error: cannot find symbol
[capacitor] TAG_FOR_CHILD_DIRECTED_TREATMENT = RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:139: error: cannot find symbol
[capacitor] TAG_FOR_CHILD_DIRECTED_TREATMENT = RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:141: error: cannot find symbol
[capacitor] TAG_FOR_CHILD_DIRECTED_TREATMENT = RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:149: error: cannot find symbol
[capacitor] TAG_FOR_UNDER_AGE_OF_CONSENT = RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:151: error: cannot find symbol
[capacitor] TAG_FOR_UNDER_AGE_OF_CONSENT = RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:153: error: cannot find symbol
[capacitor] TAG_FOR_UNDER_AGE_OF_CONSENT = RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:158: error: cannot find symbol
[capacitor] String MAX_AD_CONTENT_RATING = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:163: error: cannot find symbol
[capacitor] MAX_AD_CONTENT_RATING = RequestConfiguration.MAX_AD_CONTENT_RATING_G;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:166: error: cannot find symbol
[capacitor] MAX_AD_CONTENT_RATING = RequestConfiguration.MAX_AD_CONTENT_RATING_PG;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:169: error: cannot find symbol
[capacitor] MAX_AD_CONTENT_RATING = RequestConfiguration.MAX_AD_CONTENT_RATING_T;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:172: error: cannot find symbol
[capacitor] MAX_AD_CONTENT_RATING = RequestConfiguration.MAX_AD_CONTENT_RATING_MA;
[capacitor] ^
[capacitor] symbol: variable RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:178: error: cannot find symbol
[capacitor] RequestConfiguration requestConfiguration = new RequestConfiguration.Builder()
[capacitor] ^
[capacitor] symbol: class RequestConfiguration
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:178: error: package RequestConfiguration does not exist
[capacitor] RequestConfiguration requestConfiguration = new RequestConfiguration.Builder()
[capacitor] ^
[capacitor] C:\Users\user\Desktop\Projects\Modular\node_modules@capacitor\android\capacitor\src\main\java\com\getcapacitor\AdMob.java:184: error: cannot find symbol
[capacitor] MobileAds.setRequestConfiguration(requestConfiguration);
[capacitor] ^
[capacitor] symbol: variable MobileAds
[capacitor] location: class com.getcapacitor.community.admob.AdMob
[capacitor]
[capacitor] > Task :capacitor-android:compileDebugJavaWithJavac FAILED
[capacitor]
[capacitor] FAILURE: Build failed with an exception.
[capacitor]
[capacitor] * What went wrong:
[capacitor] Execution failed for task ':capacitor-android:compileDebugJavaWithJavac'.
[capacitor] > java.lang.NullPointerException
[capacitor]
[capacitor] * Try:
[capacitor] Run with --stacktrace
[capacitor] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[capacitor]
[capacitor] option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to
get full insights.
[capacitor]
[capacitor] * Get more help at https://help.gradle.org
[capacitor] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[capacitor]
[capacitor] See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
[capacitor]
[capacitor] BUILD FAILED in 1m 33s
[capacitor] 86 actionable tasks: 9 executed, 77 up-to-date
[capacitor]
[ERROR] An error occurred while running subprocess capacitor.
capacitor.cmd run android --target exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
`

System Infomation

Ionic:

Ionic CLI : 6.16.3 (C:\Users\user\AppData\Roaming\nvm\v16.5.0\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 5.6.11
@angular-devkit/build-angular : 12.0.5
@angular-devkit/schematics : 12.1.2
@angular/cli : 12.0.5
@ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.1.1
@capacitor/android : 3.1.1
@capacitor/core : 3.1.1
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.3
native-run : 1.4.0

System:

NodeJS : v16.5.0 (C:\Program Files\nodejs\node.exe)
npm : 7.19.1
OS : Windows 10

@distante
Copy link
Contributor

Are you using minifyEnabled, proguardFiles or shrinkResources? This sounds like a problem with it.

@sergemaunda
Copy link
Author

Are you using minifyEnabled, proguardFiles or shrinkResources? This sounds like a problem with it.

I have a android\app\proguard-rules.pro file, is this file the reason why I'm getting errors?

@distante
Copy link
Contributor

Yes, it is a know problem proguard doesn't play nice with capacitor/Cordova apps.

AFAIK there are some configs that can fix that but you have to check in the capacitor repo.

@sergemaunda
Copy link
Author

I checked minifyEnabled and shrinkResources, both are false.

I also tried the following config from the capacitor repo for the proguard-rules.pro file:

  -keep,allowobfuscation @interface com.getcapacitor.NativePlugin,com.getcapacitor.PluginMethod
  -keep @com.getcapacitor.NativePlugin class * { *; }
  -keepclasseswithmembernames class * {@com.getcapacitor.PluginMethod public *;}

I still get the same error.

@sergemaunda sergemaunda changed the title Issue with capacitor-community/admob when trying to build project Issue with capacitor-community/admob when trying to debug project Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants