IamKingWaiMark / GoogleAdmobBlueprint

Support git for GoogleAdmobBlueprint Plugin
0 stars 0 forks source link

Having some trouble using AdMob Blueprint plugin. InterstitialAd; #1

Closed NikolayEltsov closed 1 year ago

NikolayEltsov commented 1 year ago

Whenever I try to make a package with it, I keep getting an error message that says:

"app\src\main\java\com\epicgames\unreal\GameActivity.java:227: error: cannot find symbol import com.google.android.gms.ads.InterstitialAd; symbol: class InterstitialAd."

I'm not using any other plugins, but when I turn on the 'AdMob Blueprint' plugin, I can't compile. When I turn it off, I don't have any problems. I tried modifying the code in line 8 -keep,includedescriptorclasses public class com.google.android.gms.ads.InterstitialAd { ; } has been replaced with -keep,includedescriptorclasses public class com.google.android.gms.ads.interstitial.InterstitialAd { ; } of the admob.pro file in UE_5.1\Engine\Plugins\Marketplace\GoogleAdmobBlueprint\Source\ThirdParty\android\admob, but it didn't help. It's possible that I didn't correctly recompile the plugin. I'm not entirely sure how to do it properly.

I try to change 'com.google.android.gms:play-services-ads:20.6.0' to 'com.google.android.gms:play-services-ads:19.7.0'. It compiled, but game crashed when I try to show Ads.

Do you have any ideas on how to fix this?

IamKingWaiMark commented 1 year ago

Hi,

Although the plugin has the admob.pro and libfirebase_admob.a files, they are not used in the build so should be good there, It is replace with GMA (Google Mobile Ads).

If you were able to package by changing the dependency to com.google.android.gms:play-services-ads:19.7.0, then the issue is that there is conflicting code/plugin relating to the dependency.

Have you tried to package on a clean project with just the plugin? This can help verify the issue.

Also, how is it crashing? Is it when you launch the app?

IamKingWaiMark commented 1 year ago

If it is crashing at the launch of the app, then you might be missing the step to add:

meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"

This is required by AdMob or it will crash the app, You can find the explanation here (Step 3):

https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk

IamKingWaiMark commented 1 year ago

You can see how to add it in Unreal Engine here:

https://codeible.com/view/videotutorial/8k92mQRVWseK67IjfOMg;title=Google%20AdMob%20Blueprint%20Plugin%20Setup

IamKingWaiMark commented 1 year ago

Hi, are you still having the issue?

NikolayEltsov commented 1 year ago

Hi, I apologize for the delay in getting back to you. I just wanted to let you know that I have packaged a clean project that only includes the plugin. The issue turned out to be related to the settings for including AdMob support for ads on the Android platform.

IamKingWaiMark commented 1 year ago

Oh great. Did everything worked out?

NikolayEltsov commented 1 year ago

Everything seems to be working out just fine! Well, almost everything. There's just one tiny issue. When I selected the "For Distribution" setting, the game crashes when I test the package on my side.

I'm not quite sure what's going on here. Maybe it'll work normally when it's in the marketplace? Let's hope so!

Anyway, just wanted to keep you in the loop. Thanks for your help so far!