gsantner / dandelion

a unofficial diaspora* client for Android
https://github.com/gsantner/dandelion
Other
113 stars 32 forks source link

touch/click on link crash the app #164

Closed Pafzedog closed 7 years ago

Pafzedog commented 7 years ago

General information

Steps to reproduce

  1. open Dandelion app
  2. Click/Touch on an external link

Expected result

What is the expected output? Launc default browser . What do you see instead? Dandelion FC/Crash

Debug output

logcat attached logcat.txt

I rollback to 1.0.1 and there is no problem
gsantner commented 7 years ago

Thanks for reporting!

08-12 17:38:31.914 E/AndroidRuntime(26235): Process: com.github.dfa.diaspora_android, PID: 26235
08-12 17:38:31.914 E/AndroidRuntime(26235): java.lang.NoSuchMethodError: No static method startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V in class Landroid/support/v4/app/ActivityCompat; or its super classes (declaration of 'android.support.v4.app.ActivityCompat' appears in /data/app/com.github.dfa.diaspora_android-2/base.apk)
08-12 17:38:31.914 E/AndroidRuntime(26235):     at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:262)
08-12 17:38:31.914 E/AndroidRuntime(26235):     at com.github.dfa.diaspora_android.web.custom_tab.CustomTabActivityHelper.openCustomTab(CustomTabActivityHelper.java:64)

Seems to be some internal crash at the Chrome/Chromium custom tab, which trys to call startActivity() statically. Maybe related to the custom-tabs lib. Can you tell me which version of chrome/ium you have installed?

Pafzedog commented 7 years ago

I don't have chrome/chromium installed on this device :s

gsantner commented 7 years ago

I cannot reproduce the problem. Tried with and without chrom/e/ium installed. Do you have maybe another differnt app that somehow suggests itself to be Chrome?

The check is done at this point: https://github.com/Diaspora-for-Android/dandelion/blob/master/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabsHelper.java#L79 and https://github.com/Diaspora-for-Android/dandelion/blob/master/app/src/main/java/com/github/dfa/diaspora_android/web/custom_tab/CustomTabsHelper.java#L82

I too lowered the butterknife dependency now (fetches a more recent appcompat inside), which maybe is related to this problem. If you can/want to try the latest git version (https://github.com/Diaspora-for-Android/dandelion/commit/c988fc3bdd731b8f3f21604a9a4e93616923713d) please tell me if it fixed your problem.

Pafzedog commented 7 years ago

I don't know if there is that kind of app installed on my custom rom CrDroid I removed Lightning browser (webkit based) and same thing happened. I removed Cesium app (I suspect it's build over chromium) but no luck :( I reboot system after removing those apps to test Dandelion .

I'm not able to build your app on my own, last times I try to build an android app are bad memories :/ Then I'll keep v1.0.1 until you release next build, I'll tell you if the problem remain at this time ;) Thanks for your time

gsantner commented 7 years ago

Oh, thanks but I didn't mean at all that you should uninstall any app! I thought of letting the app run, and check if there is some value being added.

Sad to hear, but I just can encourage you to to try it again :D. Downloading Android Studio, install some needed SDK stuff and you are ready :D.

What about that: I can build an apk which you can install. That one will include a Log command exactly at that line said above. and you send the log again.

Pafzedog commented 7 years ago

ok, If you build one, I'll try it and send you the log (it's better for my mental health :D )

vanitasvitae commented 7 years ago

Here is a log from my device:

08-13 13:06:36.441  5687  5687 D AndroidRuntime: Shutting down VM
--------- beginning of crash
08-13 13:06:36.447  5687  5687 E AndroidRuntime: FATAL EXCEPTION: main
08-13 13:06:36.447  5687  5687 E AndroidRuntime: Process: com.github.dfa.diaspora_android, PID: 5687
08-13 13:06:36.447  5687  5687 E AndroidRuntime: java.lang.NoSuchMethodError: No static method startActivity(Landroid/app/Activity;Landroid/content/Intent;Landroid/os/Bundle;)V in class Landroid/support/v4/app/ActivityCompat; or its super classes (declaration of 'android.support.v4.app.ActivityCompat' appears in /data/app/com.github.dfa.diaspora_android-2/base.apk)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.support.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:262)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.github.dfa.diaspora_android.web.custom_tab.CustomTabActivityHelper.openCustomTab(CustomTabActivityHelper.java:64)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.github.dfa.diaspora_android.receiver.OpenExternalLinkReceiver.onReceive(OpenExternalLinkReceiver.java:75)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:297)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:46)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:116)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6124)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:882)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.android.internal.os.ExecInit.main(ExecInit.java:74)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
08-13 13:06:36.447  5687  5687 E AndroidRuntime:    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:262)
08-13 13:06:36.448  5687  5687 E AndroidRuntime: Error reporting crash
08-13 13:06:36.448  5687  5687 E AndroidRuntime: java.lang.RuntimeException: Bad file descriptor
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at android.os.BinderProxy.transactNative(Native Method)
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at android.os.BinderProxy.transact(Binder.java:615)
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:5133)
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:97)
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
08-13 13:06:36.448  5687  5687 E AndroidRuntime:    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
08-13 13:06:36.449  5687  5687 I Process : Sending signal. PID: 5687 SIG: 9
08-13 13:06:36.496  3633  3654 I WindowManager: WIN DEATH: Window{6d2ce95 u0 com.github.dfa.diaspora_android/com.github.dfa.diaspora_android.activity.MainActivity}
08-13 13:06:36.497  3633  6022 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=16, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@5e5c70c)
08-13 13:06:36.497  3633  6029 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=15, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@4c39855)
08-13 13:06:36.497  3633  3653 I ActivityManager: Process com.github.dfa.diaspora_android (pid 5687) has died

Same cause apparently. I have Chromium 60.0.3112.78 installed.

gsantner commented 7 years ago

@vanitasvitae can you try current git version?

vanitasvitae commented 7 years ago

sure, give me a sec

vanitasvitae commented 7 years ago

current master fixed the issue for me.

gsantner commented 7 years ago

fix will be included in next release