This problem came back and the solution I mentioned in my original post no longer worked. I spent hours trying to figure out what the problem could be. The app works fine on a Nexus 6P running Android 8.1. But running it on a Pixel 2 XL (Android 11) would crash on startup. I tried the following:
- Uninstalled the app multiple times
- Cleaned my build
- Restarted device multiple times
- Made sure the app had all the required permissions
In the end, I began to suspect that the version my app was running was not the actual version being installed. This led me to go to my Google Drive account where Android stores backups and deleted the device’s backup. I then uninstalled the app and restarted the device. After manually setting the permissions, the app no longer crashed.
The app crashes when:
ZoomInstantSDK.getInstance().initialize(context, params)
is called. The initialize function internally reads stuff from Shared Preferences. The crash occurs most likely because the value of some Shared Preference is being set to null and this null value is being used somewhere else. Your developers should add code to test if the value is null when read from Shared Preferences and set it to some default value if it is.
By default, Android will backup these Shared Preference values to a user’s Google Drive account when the device’s backup is done and restore those values if the app gets reinstalled. This means, that for whatever reason, if the value got set to null on the device, it will be restored to null and result in crashes.
Not setting the Shared Preferences values to a default value when they are read as null should be consider a major bug as it will prevent the user from running future updates of an app when those values get set to null.
In my original post, the log output indicates where you should be focusing on the problem:
com.zipow.videobox.util.PreferenceUtil.readStringValue(PreferenceUtil.java:312)
Others have posted a similar problem related to PreferenceUtil reading stuff, so this is clearly an issue that needs to be fixed.