Platform: Windows 10
Fuse version: 0.12.2 (build 6303)
Issue:
The error (unknown): I0000: Failed to compile .NET type 'LaunchApp': The invoked member is not supported before the type is created. will occur when running fuse preview and Uno file contains ForeignInclude. If you comment out ForeignInclude fuse preview will compile without error.
Expected Outcome:
fuse preview compiles and launches
To Recreate:
- Install below test app on device
- Run
fuse preview
Test App:
LaunchApp.uno
using Uno;
using Uno.Collections;
using Fuse;
using Fuse.Triggers.Actions;
using Uno.Compiler.ExportTargetInterop;
[ForeignInclude(Language.Java, "com.fuse.Activity", "android.content.Context", "android.content.Intent", "android.net.Uri", "android.widget.Toast")]
public class LaunchApp : TriggerAction
{
protected override void Perform(Node target)
{
if defined(Android)
{
// Do Android/iOS Stuff
OpenApp();
} else {
debug_log("LaunchApp is only for Android");
}
}
[Foreign(Language.Java)]
public extern(Android) void OpenApp()
@{
// Do something here
@}
}
MainView.ux
<App Theme="Basic">
<Button Text="Open App">
<Tapped>
<LaunchApp />
</Tapped>
</Button>
</App>