1. Causes:
1. Change the user profile picture
2, picture compression
3. A null pointer exception occurs
(Java. Lang. NullPointerException: Attempt to invoke virtual method ‘int android. Graphics. Bitmap. GetWidth ()’ on a null The object reference)
Bitmap.getwidth () is empty for a number of reasons, but I only have this bug for Android 10 + phones; Failed to select album for Android 10
2. Solutions:
1. Check whether targetSdkVersion is above 29, if it is a lower version;
Or 2, add to androidmanifest.xml:
<application ......
android:requestLegacyExternalStorage="true"
>