Skip to content

Error in Android: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes() #24

@arturomf

Description

@arturomf

I have this plugin installed in a Ionic 5 app. It is working on iOS but on android, it throws that exception in any kommunicate function call. For example:

this.kommunicate.login(kmUser);

I have tried different methods and it's always the same error:

2020-11-18 18:11:38.273 12458-2262/com.lullaai W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes()' on a null object reference
2020-11-18 18:11:38.273 12458-2262/com.lullaai W/System.err:     at android.util.Base64.decode(Base64.java:120)
2020-11-18 18:11:38.273 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicommons.encryption.SecurityUtils.getAESKey(SecurityUtils.java:154)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicommons.data.SecureSharedPreferences.<init>(SecureSharedPreferences.java:39)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicommons.data.AlPrefSettings.<init>(AlPrefSettings.java:31)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicommons.data.AlPrefSettings.getInstance(AlPrefSettings.java:36)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicomkit.Applozic.getApplicationKey(Applozic.java:85)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicomkit.api.MobiComKitClientService.getApplicationKey(MobiComKitClientService.java:52)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicomkit.api.account.user.MobiComUserPreference.renameSharedPrefFile(MobiComUserPreference.java:107)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicomkit.api.account.user.MobiComUserPreference.<init>(MobiComUserPreference.java:94)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at com.applozic.mobicomkit.api.account.user.MobiComUserPreference.getInstance(MobiComUserPreference.java:101)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at io.kommunicate.Kommunicate.isLoggedIn(Kommunicate.java:470)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at io.kommunicate.KmConversationHelper.createOrLaunchConversation(KmConversationHelper.java:385)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at io.kommunicate.KmConversationBuilder.launchConversation(KmConversationBuilder.java:217)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at io.kommunicate.phonegap.KommunicateCordovaPlugin.execute(KommunicateCordovaPlugin.java:250)
2020-11-18 18:11:38.274 12458-2262/com.lullaai W/System.err:     at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at android.os.MessageQueue.nativePollOnce(Native Method)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at android.os.MessageQueue.next(MessageQueue.java:335)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at android.os.Looper.loop(Looper.java:195)
2020-11-18 18:11:38.275 12458-2262/com.lullaai W/System.err:     at android.os.HandlerThread.run(HandlerThread.java:67)

Any Idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions