Closed SMJ93 closed 3 years ago
@SMJ93 Fix for this issue was added into react-native-appodeal@2.7.7.
@staskochkin, Android now crashes with the following:
11-18 15:48:09.117 11244 11368 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/appodeal/ads/bt;
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.appodeal.ads.aq.a(Unknown Source:4)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.appodeal.ads.Appodeal.setTriggerOnLoadedOnPrecache(Unknown Source:32)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.appodeal.rnappodeal.RNAppodealModule.setOnLoadedTriggerBoth(RNAppodealModule.java:273)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.Thread.run(Thread.java:919)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: com.appodeal.ads.bt
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.VMClassLoader.findLoadedClass(Native Method)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
11-18 15:48:09.117 11244 11368 E AndroidRuntime: ... 13 more
11-18 15:48:09.117 11244 11368 E AndroidRuntime: Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/appodeal/ads/r;
11-18 15:48:09.117 11244 11368 E AndroidRuntime: ... 13 more
How do you call setOnLoadedTriggerBoth
? It takes the boolean value as an argument.
Appodeal.setOnLoadedTriggerBoth(false);
@staskochkin using Appodeal.setOnLoadedTriggerBoth(true)
.
It works fine on iOS, but Android crashes.
Here is all of my initialising code:
export function initialiseAppodeal() {
// Generic settings
// Set ad auto caching enabled or disabled
// By default autocache is enabled for all ad types
// Call this method before or after initilisation
Appodeal.setAutoCache(AppodealAdType.BANNER, true)
// Set testing mode
// Call this method before initilisation
Appodeal.setTesting(isDev)
// Set Appodeal SDK logging level
// Call this method before initilisation
const logLevel = isDev ? AppodealLogLevel.DEBUG : AppodealLogLevel.NONE
Appodeal.setLogLevel(logLevel)
// Enable or disable child direct threatment
// Call this method before initilisation
Appodeal.setChildDirectedTreatment(false)
// Disable network:
// Call this method before initilisation
// Appodeal.disableNetwork("some_network")
// Disable network for specific ad type:
// Call this method before initilisation
// Appodeal.disableNetwork("some_network ", AppodealAdType.INTERSTITIAL)
// Enable or disable triggering show for precache ads
// Call this method before or after initilisation
Appodeal.setOnLoadedTriggerBoth(true)
// Disable location permission
// Call this method before initilisation
Appodeal.disableLocationPermissionCheck()
// Banner specific settings
// Enable or disable tablet banners.
// Call this method before of after initilisation
Appodeal.setTabletBanners(isLargeDevice)
// Enable or disable smart banners.
// iOS smart banners are supported only
// for applications where autoration is disabled
// Call this method before of after initilisation
Appodeal.setSmartBanners(false)
// Enable or disable banner refresh animation
// Call this method before of after initilisation
Appodeal.setBannerAnimation(true)
// Enable or disable banner background
// Call this method before of after initilisation
Appodeal.setBannerBackground(false)
// Android specific settings
// Mute calls if calls muted on Android
// Call this method before initilisation
if (!isIOS) {
Appodeal.muteVideosIfCallsMuted(true)
// Disable write external permission warning on app start if its missing
// Call this method before initilisation
Appodeal.disableWriteExternalStoragePermissionCheck()
// Request Android M permissions on app start
// Call this method before initilisation
// Appodeal.requestAndroidMPermissions()
}
// Initialise
const appodealKey = getAppodealKey()
const adTypes =
AppodealAdType.INTERSTITIAL |
AppodealAdType.REWARDED_VIDEO |
AppodealAdType.BANNER
const consent = true
Appodeal.initialize(appodealKey, adTypes, consent)
}
Hi @staskochkin, setting Appodeal.setOnLoadedTriggerBoth(false)
results in Android building 🎉
I am still having problems with Android though. The test Advert doesn't loaded and onAdFailedToLoad
doesn't fire. It is working as expected on iOS.
Hi, this looks like a great alternative to AdMob, but I am having a lot of difficulty getting it working on Android.
I've followed the instructions in the Read me and installed:
"react-native-appodeal": "2.7.6"
On Android I get the following when initialising:
Looking at
requestAndroidMPermissions.ts
it looks like you are parsing through a callback, but not in expecting it in the Java code?Env: