Open eksperts opened 6 years ago
The forum thread InterApp cause a crash if target app is not installed posted by raphael.godoi@gmail.com was linked to this issue.
This seems to go from a simple error to a fatal crash due to our bad V8 build :/
I suspect that something like this makes the bad owie go away:
diff --git a/Source/Fuse.Android/AndroidInterop.uno b/Source/Fuse.Android/AndroidInterop.uno
index 94b4713101..76f4f771bf 100644
--- a/Source/Fuse.Android/AndroidInterop.uno
+++ b/Source/Fuse.Android/AndroidInterop.uno
@@ -25,7 +25,16 @@ namespace Fuse.Android.Bindings
pendingIntent.setClassName(packageName, className);
Activity a = com.fuse.Activity.getRootActivity();
- a.startActivity(pendingIntent);
+ try
+ {
+ a.startActivity(pendingIntent);
+ }
+ catch (ActivityNotFoundException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+
return pendingIntent;
@}
@cbaggers: You're our resident ☕️ expert, what do you think about a change like that? I see little reason to propagate the exception out to the user...
Fuse 1.4.0 build 14778, macOS. Testing on a Nexus 5 with Android 6, likely other versions affected too.
When there is no handler for a particular URI-scheme available on an Android device, the call to
InterApp.launchUri()
results in a fatal crash.A repro (don't forget
"Fuse.Launcher"
in.unoproj
):We get this in logs when
fuse preview -tandroid
:When debugging in Android Studio after
fuse build -tandroid -d
:A wild guess, and probably not the right solution, but perhaps some safeguarding around this line could avoid the crash: https://github.com/fusetools/fuselibs-public/blob/master/Source/Fuse.Android/AndroidInterop.uno#L28