react-native-appodeal icon indicating copy to clipboard operation
react-native-appodeal copied to clipboard

TypeError: Cannot read property 'initializeWithAppKey' of null

Open wDRxxx opened this issue 1 year ago • 2 comments

Hello, I followed the installation instructions and during the initialization I get an error: TypeError: Cannot read property 'initializeWithAppKey' of null image Code that crashes me: image I have this error in just created expo project. I also tried to use 'npx expo prebuild' I hope for help, thanks

wDRxxx avatar Jul 29 '23 10:07 wDRxxx

Have this issue too. Looks like I can't initialize Appodeal from App component and show initialize it from Screen component inside App. Looks like it throws on the line com.appodeal.rnappodeal.RNAppodealModule.initializeWithAppKey (RNAppodealModule.java:63):

Appodeal.initialize(getCurrentActivity(),
                appKey,
                RNAppodealUtils.getAdTypesFormRNTypes(adTypes),
                list -> sendEventToJS("onAppodealInitialized", null)
        );

it can't retrieve activity (getCurrentActivity() returns null).

It's lack of the documentation or bug in the current version, which turns into Crash time by time in Google Play Console for my title.

Dem0n13 avatar Nov 19 '23 20:11 Dem0n13

Hi @Dem0n13 , have you fix this error ?

elwadi avatar May 02 '24 20:05 elwadi