Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to login in release mode #28

Closed
adnedelcu opened this issue Jan 20, 2021 · 13 comments
Closed

Unable to login in release mode #28

adnedelcu opened this issue Jan 20, 2021 · 13 comments
Assignees

Comments

@adnedelcu
Copy link
Contributor

Hello.

I have implemented the Flutter plugin and it works great while in debug mode, but when I try the same functionality in release mode, login fails and without login I can't open a conversation.

I have tried both login as existing user with KommunicateFlutterPlugin.login([user info]) and login as visitor with KommunicateFlutterPlugin.loginAsVisitor(APP_ID).

All the package returns on .catchError is PlatformException(Error, null, null, null).

After I put some log messages, I found the real exception, but unable to figure out where it comes from as I am unable to debug.

java.lang.NullPointerException
        at g.c.p.c$a.a(Unknown Source:3)
        at g.c.s.a.a(Unknown Source:33)
        at g.c.s.a.a(Unknown Source:38)
        at g.c.k.l.a(Unknown Source:60)
        at g.c.k.l.doInBackground(Unknown Source:2)
        at android.os.AsyncTask$3.call(AsyncTask.java:394)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

Same exception is thrown when I try .login() and .loginAsVisitor().

@adnedelcu
Copy link
Contributor Author

adnedelcu commented Jan 22, 2021

The error above was happening on package 1.1.2. Today I tried with 1.1.3 and it happens on both packages. Same exception, but different stacktrace.

java.lang.NullPointerException
        at g.c.p.c$a.a(Unknown Source:3)
        at g.c.s.a.a(Unknown Source:33)
        at g.c.s.a.a(Unknown Source:38)
        at g.c.k.l.a(Unknown Source:60)
        at g.c.k.l.a(Unknown Source:0)
        at com.applozic.mobicommons.task.executor.ExecutorAsyncTask.b(Unknown Source:0)
        at com.applozic.mobicommons.task.executor.ExecutorAsyncTask$1.call(Unknown Source:13)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)

@reytum
Copy link
Contributor

reytum commented Jan 22, 2021

@adnedelcu Please add the below rules in your proguard-rules.pro file: https://docs.kommunicate.io/docs/android-installation.html#building-with-proguard

@adnedelcu
Copy link
Contributor Author

I don't have a proguard-rules.pro file. Where would I create this file in my flutter project?

@adnedelcu
Copy link
Contributor Author

I managed to find out where to put the file, but the iOS release version of the application crashes when trying to create a new chat.

@adnedelcu
Copy link
Contributor Author

This is the exception that the application crashes with.

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001064decac
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [1637]
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   Kommunicate                   	0x00000001064decac Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value + 0 (KMAppSettingsService.swift:16)
1   Kommunicate                   	0x00000001064decac default argument 0 of KMAppSettingService.appSetting(applicationKey:completion:) + 0 (KMAppSettingsService.swift:16)
2   Kommunicate                   	0x00000001064decac specialized static Kommunicate.createConversation(conversation:completion:) + 1512 (Kommunicate.swift:218)
3   Kommunicate                   	0x00000001064decac Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value + 0 (KMAppSettingsService.swift:16)
4   Kommunicate                   	0x00000001064decac default argument 0 of KMAppSettingService.appSetting(applicationKey:completion:) + 0 (KMAppSettingsService.swift:16)
5   Kommunicate                   	0x00000001064decac specialized static Kommunicate.createConversation(conversation:completion:) + 1512 (Kommunicate.swift:218)
6   Kommunicate                   	0x00000001064b834c specialized static Kommunicate.createConversation(conversation:completion:) + 16 (KMConversation.swift:0)
7   Kommunicate                   	0x00000001064b834c KMConversationListViewController.createConversationAndLaunch() + 16
8   Kommunicate                   	0x00000001064b834c KMConversationListViewController.compose() + 180 (KMConversationListViewController.swift:477)
9   Kommunicate                   	0x00000001064b834c 0x106490000 + 164684 (KMConversationListViewController.swift:398)
10  Kommunicate                   	0x00000001064b8390 @objc KMConversationListViewController.compose() + 28 (<compiler-generated>:0)
11  UIKitCore                     	0x000000018554501c -[UIApplication sendAction:to:from:forEvent:] + 96 (UIApplication.m:5006)
12  UIKitCore                     	0x0000000184b30438 -[UIBarButtonItem _triggerActionForEvent:] + 176 (UIBarButtonItem.m:765)
13  UIKitCore                     	0x0000000184b096d8 __45-[_UIButtonBarTargetAction _invoke:forEvent:]_block_invoke + 36 (UIButtonBar.m:1229)
14  UIKitCore                     	0x0000000184b0958c -[_UIButtonBarTargetAction _invoke:forEvent:] + 168 (UIButtonBar.m:1235)
15  UIKitCore                     	0x000000018554501c -[UIApplication sendAction:to:from:forEvent:] + 96 (UIApplication.m:5006)
16  UIKitCore                     	0x0000000184eda3cc -[UIControl sendAction:to:forEvent:] + 240 (UIControl.m:842)
17  UIKitCore                     	0x0000000184eda710 -[UIControl _sendActionsForEvents:withEvent:] + 352 (UIControl.m:913)
18  UIKitCore                     	0x0000000184ed9048 -[UIControl touchesEnded:withEvent:] + 532 (UIControl.m:608)
19  UIKitCore                     	0x00000001850bf414 _UIGestureEnvironmentUpdate + 6676 (UIGestureEnvironment.m:651)
20  CoreFoundation                	0x0000000182c5487c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1799)
21  CoreFoundation                	0x0000000182c4ef50 __CFRunLoopDoObservers + 604 (CFRunLoop.c:1912)
22  CoreFoundation                	0x0000000182c4f498 __CFRunLoopRun + 960 (CFRunLoop.c:2953)
23  CoreFoundation                	0x0000000182c4eba0 CFRunLoopRunSpecific + 572 (CFRunLoop.c:3242)
24  GraphicsServices              	0x000000019998c598 GSEventRunModal + 160 (GSEvent.c:2259)
25  UIKitCore                     	0x000000018553e3d8 -[UIApplication _run] + 1052 (UIApplication.m:3253)
26  UIKitCore                     	0x0000000185543958 UIApplicationMain + 164 (UIApplication.m:4707)
27  Runner                        	0x000000010458983c main + 68 (AppDelegate.swift:6)
28  libdyld.dylib                 	0x000000018292d568 start + 4

@mukeshthawani
Copy link
Contributor

Make sure the user is logged in. This could happen when the application ID is not present. Application ID is saved when the user logs in and removed when the user logs out.

@adnedelcu
Copy link
Contributor Author

The same code works in debug mode and we are not logging out the customer unless they use the logout function of the app.

@mukeshthawani
Copy link
Contributor

Can you reinstall the app and reproduce this issue after a fresh login?
Also, if there are any logs in the Xcode console, then share that with us through support chat.

@adnedelcu
Copy link
Contributor Author

We have decided to try to integrate another solution as we have spent 2 weeks trying to fix this issue and we're nowhere close to fixing it. The slow response time does not help.

@mukeshthawani
Copy link
Contributor

@adnedelcu Sorry for the delay in response. You had another issue earlier, you mentioned this specific issue five days ago, and we replied it as soon as we could. This is the first time someone has faced this issue. We hope you'll give another try, we can also connect and check if you want to.

@adnedelcu
Copy link
Contributor Author

It's not just about this problem now. It's also about the time it took 7 days for the team to say no to the pull request we need for our integration or the fact that I asked a question in this very issue about where to put the proguard-rules.pro file in the project and nobody answered.

@Samir1810
Copy link
Contributor

Hi Daniel,

We extremely apologize for the delay and for causing you trouble. We always try to resolve the customer issues ASAP even connecting via call as well. Looks like we missed your comment, we're very much sorry for that. Our tech is on leave for few days and needs to get his comment that's why the delay occurred for the pull request. Meanwhile, if you have any issues, you can also book a tech call from here https://calendly.com/kommunicate/support?back=1&month=2021-02 we'll involve our mobile developers to resolve quickly. Again sorry for the inconvenience caused :(

@adnedelcu
Copy link
Contributor Author

Our testers tried again the same build that was crashing and it now works. I can't explain what happened then or why it works now and didn't then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants