Pushwoosh / pushwoosh-xamarin

12 stars 18 forks source link

NullPointerException after migration to Android 14 + PlayStore rejection #39

Open CristianValencia opened 1 month ago

CristianValencia commented 1 month ago

Documentation

Checked the guide, but didn't find the information needed.

System Details

Xamarin.Forms: 5.0.0.2578 Pushwoosh 6.0.9 Pushwoosh.Inbox 6.0.9

Issue

After migrating the Android target version to API Level 34 (Android 14), I'm facing with a crash report in the PlayStore. Output log from the console is:

Exception java.lang.NullPointerException: at java.util.concurrent.ConcurrentHashMap.putVal (ConcurrentHashMap.java:1019) at java.util.concurrent.ConcurrentHashMap.put (ConcurrentHashMap.java:1014) at com.pushwoosh.tags.TagsBundle$Builder.putString at com.pushwoosh.appevents.b.a at com.pushwoosh.appevents.b.b at com.pushwoosh.appevents.b.$r8$lambda$wM6ZUF4D5rQOwbRO-7VWDwxRdA0 at com.pushwoosh.appevents.b$$ExternalSyntheticLambda0.a at com.pushwoosh.appevents.a.a at com.pushwoosh.appevents.a.$r8$lambda$9N9XFCcD-8TA_QcQE6N2DZJ6cco at com.pushwoosh.appevents.a$$ExternalSyntheticLambda0.run at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:201) at android.os.Looper.loop (Looper.java:288) at android.app.ActivityThread.main (ActivityThread.java:7870) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)

Also, from what I've researched this issue looks like this one: https://github.com/Pushwoosh/pushwoosh-android-sdk/issues/188.

That ticket was resolved by adding a fix in version 6.7.11+. However, since Pushwoosh nuget (v6.0.9) is still using Android bindings with version 6.7.10 I am experiencing the crash.

As an addition to that, I am not sure if that issue translates into the following PlayStore error:

Incorrectly registered broadcast receiver Apps targeting Android 13 or later must specify the export behavior when calling registerReceiver(). Having unspecified export behavior may cause your app to crash.

When I see the details in the closed track testing, the above log appears as the detail.

Summary

Update bindings to target Android Pushwoosh 6.7.12.

--

I can provide additional info no problem.

Screenshot 2024-08-08 at 12 17 26 p m

Screenshot 2024-08-08 at 2 35 21 p m

Screenshot 2024-08-08 at 2 37 05 p m

Screenshot 2024-08-08 at 2 43 14 p m
wfhm commented 1 month ago

@CristianValencia Hey, we've just updated our Nuget packages to the latest Pushwoosh SDK versions. The crash should be fixed now.

Please note that the plugin now uses the latest Pushwoosh Android SDK, so integration slightly changed. You'll have to add the following meta-data to your AndroidManifest.xml:

 <meta-data
            android:name="com.pushwoosh.apitoken"
            android:value="your_api_token" />

The API token here is the API Access token from Pushwoosh Control Panel.

Also, since Xamarin is no longer supported by Microsoft, Pushwoosh Xamarin nuget is now deprecated. There are no futher planned updates to the plugin (however we might update native SDKs in the packages upon request).

Finally, regarding the Android 13 broadcast receiver restrictions:

Incorrectly registered broadcast receiver Apps targeting Android 13 or later must specify the export behavior when calling registerReceiver(). Having unspecified export behavior may cause your app to crash.

The package itself does not register any receivers, it is done on a native Pushwoosh Android SDK level, and all receivers were properly updated long before the 6.7.10 release. So, most likely, the error comes from one of the transitive dependencies our package add. Could you please share the list of your packages with their versions?