Open amitkhoth opened 4 years ago
@chamons There is a workaround for this. Add FormViewGroup.jar in android native Project after that it can launch xamarin.form page successfully. can you explain why Embeddinator is not adding support for this?
As I noted in another issue recently:
There currently is not active development by members of the Xamarin team, but we are triaging incoming issues and assisting where it makes sense.
As a community project, the hope is that people will be able to build upon it to bundle C# libraries in native libraries....
Steps to Reproduce
Tool used - Visual Studio for mac
This AAR file is creating a fragment using Content Page.
This fragment is launched from Native APP.
public class FormPage : ContentPage { public FormPage() { var button = new Button { Text = "Click Me Plugin2!", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, };
}
Expected Behavior
Native Android App should launch the xamain.form Page.
Actual Behavior
App is crashed when getPageFragment is called from Native App. Application is crashed when fragment is created.
Environment
Build Logs
Java.Lang.ClassNotFoundException: md5b60ffeb829f638581ab2bb9b1a7f4f3f.PageRenderer ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Lmd5b60ffeb829f638581ab2bb9b1a7f4f3f/VisualElementRenderer_1; ---> Java.Lang.ClassNotFoundException: md5b60ffeb829f638581ab2bb9b1a7f4f3f.VisualElementRenderer_1 ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Lcom/xamarin/forms/platform/android/FormsViewGroup; ---> Java.Lang.ClassNotFoundException: Didn't find class "com.xamarin.forms.platform.android.FormsViewGroup" on path: DexPathList[[zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/base.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/lib/arm64, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/base.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.example.hellowshareduijava-KWYYOz-8C3bQ6goXjdG0_w==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] 02-19 17:33:29.332 3514 3514 E mono : --- End of inner exception stack trace --- 02-19 17:33:29.332 3514 3514 E mono : --- End of inner exception stack trace --- 02-19 17:33:29.332 3514 3514 E mono : --- End of inner exception stack trace --- 02-19 17:33:29.332 3514 3514 E mono : --- End of inner exception stack trace --- 02-19 17:33:29.332 3514 3514 E mono : at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00114] inExample Project (If Possible)
public class FormPage : ContentPage { public FormPage() { var button = new Button { Text = "Click Me Plugin2!", VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, };
//////////helper class////////////// [Register("plugin.droid.Helper")] public class Helper : Java.Lang.Object { public Helper() : base() { }
Now use this GetPageFragment API from Android Native APPl in MainActivity.java Helper helpers = new Helper(); Fragment frag = helpers.getPageFragment(MainActivity.this); Application is crashed when fragment is created.