SimpleMobileTools / Simple-SMS-Messenger

An easy and quick way of managing SMS and MMS messages without ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
610 stars 218 forks source link

v5.12.1 - broken with "Show private contacts..." enabled #298

Closed biopsin closed 2 years ago

biopsin commented 2 years ago

Oh daamn me; all messages wiped upon update, a toast message appear on app start

An error occured: java.lang.NullPointerException
Parameter specified as non-null is null:
method kotlin.jvm.internal.ln
trinsics.checkNotNullParameter,
parameter <this>

Edit: Phu reverted to 5.12.0 and messages are back, however this is weird as I wiped all data and reinstalled?? ..this is from the playstore

However I no longer see any contacts when trying to create new message from the contactlist (contacts v.6.17.1)

tibbi commented 2 years ago

They are not wiped, it is just an error at fetching... Guess you use the privately stored contacts in Simple Contacts Pro?

biopsin commented 2 years ago

Yup its enabled, should I test without? It works again after the update to 5.12.1 and disabling "Show private contacts..." in Contacts Pro But I still no longer see contacts when creating new message

biopsin commented 2 years ago

So I suppose the issue is rather in contacts pro v.6.17.1 and Show private contacts..." ?

Aga-C commented 2 years ago

I've found that issue happens since this commit: https://github.com/SimpleMobileTools/Simple-SMS-Messenger/commit/591f473a1f2c4e9eaf12e8127bcede2349b67736.

Aga-C commented 2 years ago

Also, Simple Dialer doesn't show private contacts (but there is no error).

Edit: Now I can't reproduce it, app just crashes like described in my comment below.

biopsin commented 2 years ago

@Aga-C with or without "Show private contacts.." ,they show if enabled, in Dialer v5.11.4

tibbi commented 2 years ago

ye, something went wrong with making normalizednumber nullable in release mode. Cant work on it now, Im off

biopsin commented 2 years ago

@tibbi no problem, I can atleast revert Contacts, Dialer and Messenger to previous version.

Aga-C commented 2 years ago

I've run Simple Contacts, Simple SMS Messenger and Simple Dialer directly on emulator via Android Studio (the latest commits) and everything works fine. However, when I install Simple Contacts from APK available on GitHub, Simple SMS Messenger displays the error, and now I can't even run Simple Dialer, the same exception happens:

E/AndroidRuntime: FATAL EXCEPTION: Thread-5
    Process: com.simplemobiletools.dialer.debug, PID: 12275
    java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter <this>
        at com.simplemobiletools.commons.extensions.StringKt.normalizePhoneNumber(Unknown Source:2)
        at com.simplemobiletools.commons.models.SimpleContact.doesContainPhoneNumber(SimpleContact.kt:39)
        at com.simplemobiletools.dialer.helpers.RecentsHelper.getRecents(RecentsHelper.kt:124)
        at com.simplemobiletools.dialer.helpers.RecentsHelper.access$getRecents(RecentsHelper.kt:16)
        at com.simplemobiletools.dialer.helpers.RecentsHelper$getRecentCalls$1$1.invoke(RecentsHelper.kt:34)
        at com.simplemobiletools.dialer.helpers.RecentsHelper$getRecentCalls$1$1.invoke(RecentsHelper.kt:28)
        at com.simplemobiletools.commons.helpers.SimpleContactsHelper$getAvailableContacts$1.invoke(SimpleContactsHelper.kt:91)
        at com.simplemobiletools.commons.helpers.SimpleContactsHelper$getAvailableContacts$1.invoke(SimpleContactsHelper.kt:29)
        at com.simplemobiletools.commons.helpers.ConstantsKt.ensureBackgroundThread(Constants.kt:371)
        at com.simplemobiletools.commons.helpers.SimpleContactsHelper.getAvailableContacts(SimpleContactsHelper.kt:29)
        at com.simplemobiletools.dialer.helpers.RecentsHelper$getRecentCalls$1.invoke(RecentsHelper.kt:28)
        at com.simplemobiletools.dialer.helpers.RecentsHelper$getRecentCalls$1.invoke(RecentsHelper.kt:22)
        at com.simplemobiletools.commons.helpers.ConstantsKt.ensureBackgroundThread$lambda-0(Constants.kt:368)
        at com.simplemobiletools.commons.helpers.ConstantsKt.$r8$lambda$ukHVGNDmwl8QsD9hCK7IQG-Hwww(Unknown Source:0)
        at com.simplemobiletools.commons.helpers.ConstantsKt$$ExternalSyntheticLambda0.run(Unknown Source:2)
        at java.lang.Thread.run(Thread.java:920)
tibbi commented 2 years ago

It affects release mode only

tibbi commented 2 years ago

Im releasing a new version, hope it will work