poqxert / godot-appodeal-android-plugin Goto Github PK
View Code? Open in Web Editor NEWAppodeal Android SDK for Godot
License: MIT License
Appodeal Android SDK for Godot
License: MIT License
Godot: 3.4.4 stable
Started researching appodeal a while ago and today I have found this repo
I didn't find anything about something called consentManager library here (I don't know what is it yet), but appodeal recommends me to use it. What can I do?
About the problem:
When listening to "rewarded_video_closed" signal my game crashes with this error:
java.lang.IllegalArgumentException: Invalid type for argument #1. Should be of type java.lang.String
at org.godotengine.godot.plugin.GodotPlugin.emitSignal(GodotPlugin.java:376)
at org.godotengine.godot.plugin.GodotPlugin.emitSignal(GodotPlugin.java:343)
at ru.poqxert.godotappodeal.GodotAppodeal.access$1700(GodotAppodeal.java:35)
at ru.poqxert.godotappodeal.GodotAppodeal$3.onRewardedVideoFinished(GodotAppodeal.java:230)
at com.appodeal.ads.q1.b(Unknown Source)
at com.appodeal.ads.q1.b(Unknown Source)
at com.appodeal.ads.n$j.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
"rewarded_video_finished" causes a crash too. Interstitial ads work fine
The crash happens at the moment when I close the rewarded ad
This is my appodeal autoload:
extends Node
var _appodeal
enum AdType {
INTERSTITIAL = 1,
BANNER = 2,
NATIVE = 4,
REWARDED_VIDEO = 8,
NON_SKIPPABLE_VIDEO = 16,
}
enum ShowStyle {
INTERSTITIAL = 1,
BANNER_TOP = 2,
BANNER_BOTTOM = 4,
REWARDED_VIDEO = 8,
NON_SKIPPABLE_VIDEO = 16,
}
func _ready():
var is_testing = !_glob_Variables.ARE_ADS_REAL
if Engine.has_singleton("GodotAppodeal"):
_appodeal = Engine.get_singleton("GodotAppodeal")
if _appodeal:
_appodeal.initialize(
"sensitive",
AdType.BANNER | AdType.INTERSTITIAL | AdType.NON_SKIPPABLE_VIDEO | AdType.REWARDED_VIDEO,
!_glob_Progress.first_launch
)
_appodeal.setTestingEnabled(is_testing)
func change_consent(consent):
if _appodeal:
_appodeal.updateConsent(consent)
func cache_ad(ad_type):
if _appodeal:
_appodeal.cacheAd(ad_type)
func show_ad(show_style):
if _appodeal:
_appodeal.showAd(show_style)
This is how I use it:
func _ready():
...
...
if _glob_Appodeal._appodeal:
_glob_Appodeal._appodeal.connect("rewarded_video_closed", self, "rewarded_video_closed")
_glob_Appodeal._appodeal.connect("interstitial_closed", self, "interstitial_closed")
...
func _on_MenuButton_pressed():
_glob_Appodeal.show_ad(_glob_Appodeal.ShowStyle.INTERSTITIAL)
func _on_AdButton_pressed():
_glob_Appodeal.show_ad(_glob_Appodeal.ShowStyle.REWARDED_VIDEO)
...
func rewarded_video_closed(finished):
if finished:
get_tree().paused = false
_glob_Progress.dollars += _glob_Waves.current_wave * dollars_for_wave
_glob_Progress.save_progress()
_glob_Waves.reset_waves()
_glob_Scenes.goto_scene(_glob_Scenes.Scenes_dict.Menu)
My GodotAppodeal.gdap (If I use the SDK versions from README of this repo, I get errors telling me that it's impossible to download those SDKs):
[config]
name="GodotAppodeal"
binary_type="local"
binary="GodotAppodeal.1.0.1.release.aar"
[dependencies]
remote=["com.appodeal.ads.sdk:core:2.11.1",
"com.appodeal.ads.sdk.networks:appodeal:2.11.1.3",
"com.appodeal.ads.sdk.networks:mraid:2.11.1.5",
"com.appodeal.ads.sdk.networks:nast:2.11.1.3",
"com.appodeal.ads.sdk.networks:vast:2.11.1.5",
"com.appodeal.ads.sdk.networks:adcolony:2.11.1.22",
"com.appodeal.ads.sdk.networks:applovin:2.11.1.24",
"com.appodeal.ads.sdk.networks:bidmachine:2.11.1.21",
"com.appodeal.ads.sdk.networks:ironsource:2.11.1.21",
"com.appodeal.ads.sdk.networks:my_target:2.11.1.22",
"com.appodeal.ads.sdk.networks:ogury:2.11.1.12",
"com.appodeal.ads.sdk.networks:unity_ads:2.11.1.17",
"com.appodeal.ads.sdk.networks:vungle:2.11.1.14"]
custom_maven_repos=["https://artifactory.appodeal.com/appodeal"]
I really have no idea what should I do :/ Any thoughts?
Have a good day! :)
The gradle build breaks when compiling on Godot v3.4.3 rc. I found a work around by recompiling the .aar in android studio to target minSdk 30 and changed my godot project's min sdk to 30 before the project built. The error comes from an incompatible androidwork with the plugin's dependencies.
To Build with gradle 7.0.2, you'll have to upgrade the gradle wrapper to
...
distributionUrl = "https://services.gradle.org/distributions/gradle-7.0.2-all.zip"
...
and Android Manifest.xml in GodotAppodeal.1.0.1-release.aar to target minSdk 30
Hi, the original .gdap file can't be compiled in godot 3.3.3 because of different sdk versions. I changed the .gdap file to
[config]
name="GodotAppodeal"
binary_type="local"
binary="GodotAppodeal.1.0.1.release.aar"
[dependencies]
remote=["com.appodeal.ads:sdk:2.10.2.+"]
custom_maven_repos=["https://artifactory.appodeal.com/appodeal"]
Also pached manifest
<application tools:replace="android:label, android:allowBackup"
and build.gradle - added jcenter() in all repositories:
repositories {
google()
jcenter()
Now it builds. But can't get that singlton from the code
_appodeal = Engine.get_singeton("GodotAppodeal")
Please update
Where do I get the singleton?
Hello, if possible, make a small example of using this plugin or take screenshots.
I'd like to see the correct way to use this plugin so I don't make too many mistakes and get up and running quickly.
I would be very grateful.
Hello. How can i update to the latest SDK version?
Using the Nativelib addon to add multidex to Godot projects is more simpler and efficient that editing the build.gradle file
not sure what this is please help
Hello I have an error when compiling the apk :
**FAILURE: Build failed with an exception.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:30:68-95
is also present at [com.appodeal.ads.sdk:core:2.7.1] AndroidManifest.xml:15:18-44 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:30:5-74:19 to override.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
**
Can you help me please ?
In Godot 3.3 stable version plugin cause game crash on startup with this error:
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process: com.the1311.astrorbit, PID: 28255
AndroidRuntime: java.lang.VerifyError: Verifier rejected class ru.poqxert.godotappodeal.GodotAppodeal: void ru.poqxert.godotappodeal.GodotAppodeal.<init>(org.godotengine.godot.Godot) failed to verify: void ru.poqxert.godotappodeal.GodotAppodeal.<init>(org.godotengine.godot.Godot): [0x6] register v2 has type Reference: org.godotengine.godot.Godot but expected Reference: android.app.Activity (declaration of 'ru.poqxert.godotappodeal.GodotAppodeal' appears in /data/app/~=/com.the1311.astrorbit/base.apk!classes4.dex)
same as this issue java.lang.VerifyError crash on Android app startup when using Android plugin in 3.2.4-rc2 #45983
this error fixed on admob plugin on this fork with this change:
public GodotAdMob(Godot godot) {
super(godot);
-- activity = godot;
++ activity = godot.getActivity();
}
and this is Update to Godot 3.3 commit in admob plugin.
Can you update this plugin to 3.3?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.