DmitriiFeshchenko / godot-appodeal-demo-project

Appodeal Plugin Demo Project for Godot GameEngine
https://wiki.appodeal.com/en/
MIT License
3 stars 1 forks source link

Built demo, but after a splash on the device it throws to desktop #1

Closed Michael-Ilyin closed 4 months ago

Michael-Ilyin commented 4 months ago

Problem

The problem is this. I was able to compile the debug APK of your demo and install it on the device (Huawei P30, supports GMS), but when I run the demo, a boot splash appears and then throws it on the desktop. It absolutely also throws out my game when I embed a plugin into it. Checkbox Custom build is checked and prepared, checkbox Appodeal is checked, the plugin is in its place (in the android/plugins folder: Appodeal.gdap + Appodeal-2.0.0-debug.aar and -release in the appodeal folder). If I disable the Appodeal plugin checkbox, then my game works and the APK itself takes up 20 MB less (but of course, because Appodeal.aar is now ignored).

Tools versions

At first I couldn’t even build the APK properly, but this was a problem with the tools versions for Godot. I updated to the following versions:

Godot Engine v3.5.3.stable.official.6c814135b Min SDK 21 Max SDK 33 (default) OpenJDK 17.0.2 2022-01-18 Gradle wrapper 7.2.1 (as indicated in config.gradle, didn't change anything) Android SDK 33.0.3 Android NDK 23.2.8568313 (as indicated in config.gradle, I updated to this version) Android Debug Bridge version 1.0.41 (Version 30.0.4-6686687)

Are these the correct versions? Or do I need even newer ones?

Logs

I can’t figure out exactly what the error is. I can’t show the logs, adb logcat produces a lot of all sorts of information, even with a filter by package name (adb logcat | findstr "org.godotengine.godotappodealdemoproject") or by exceptions (adb logcat | findstr " E " - sorry, that's all for now I know how to use adb manually through the terminal, except for adb install), I don’t understand what the error is related to.

I can only guess that there was an error during Admob initialization, judging by this logcat block:

02-13 22:32:42.108  2803  2803 E AndroidRuntime: FATAL EXCEPTION: main
02-13 22:32:42.108  2803  2803 E AndroidRuntime: Process: org.godotengine.godotappodealdemoproject, PID: 2803
02-13 22:32:42.108  2803  2803 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime: ******************************************************************************
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * should follow the instructions here:                                       *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * to add a valid App ID inside the AndroidManifest.                          *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * Google Ad Manager publishers should follow instructions here:              *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: ******************************************************************************
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:8173)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.installContentProviders(ActivityThread.java:7709)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7573)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.access$2600(ActivityThread.java:260)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2435)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:110)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:219)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8668)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
02-13 22:32:42.108  2803  2803 E AndroidRuntime: Caused by: java.lang.IllegalStateException:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime: ******************************************************************************
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers    *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * should follow the instructions here:                                       *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * https://googlemobileadssdk.page.link/admob-android-update-manifest         *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * to add a valid App ID inside the AndroidManifest.                          *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * Google Ad Manager publishers should follow instructions here:              *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest.   *
02-13 22:32:42.108  2803  2803 E AndroidRuntime: ******************************************************************************
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at com.google.android.gms.ads.internal.client.zzek.attachInfo(com.google.android.gms:play-services-ads-lite@@22.3.0:26)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@22.3.0:1)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        at android.app.ActivityThread.installProvider(ActivityThread.java:8168)
02-13 22:32:42.108  2803  2803 E AndroidRuntime:        ... 10 more

By the way, the only thing I definitely did NOT do was point 5 of your instructions from the godot-appodeal-editor-plugin repository, because I can't create an AdMob for myself in my country.

5. Open the /android/build/AndroidManifest.xml file in a text editor and add the GAD App Id as per instruction.

Disabling network

So I want to not use this network. If I understand correctly, Appodeal allows you to disable the AdMob network and not use it. But I don't understand how to disable it in the plugin. Is this possible? Commenting out the line in the manifest <uses-permission android:name="com.google.android.gms.permission.AD_ID" /> didn't help... And I’m not sure that the builder together with Godot doesn't ignore my attempts to do it comment out. If this is the error, can I disable google admob network? Before compiling in the manifest (but I don’t know how to do it correctly), because in gdscript the functions Appodeal.disable_network(AppodealNetwork.ADMOB) and/or Appodeal.disable_network(AppodealNetwork.ADMOB_MEDIATION) don't solve the problem. Also throws it away.

I don’t understand how to manually connect the Appodeal SDK according to the official documentation. Everywhere it says "download the SDK", but there is not a single download link anywhere. Therefore I would like to use a plugin.

Now I'd like to simply build your demo so that it works on the device.

DmitriiFeshchenko commented 4 months ago

This crash happens because of the missing AdMob App ID. There are several ways you can fix this. The simplest solution is to add a random AdMob App ID of a valid format. Disabling the network can't help, because you need to remove the dependencies from the app, not just tell Appodeal SDK not to use this network which this method does. If you want to remove the AdMob SDK from your build, you need to find an Appodeal.gdap file in the plugin's content and replace this line with separate deps, similar to what you can see here. Alternatively, you can download needed libs and add them as local deps.