发生单声道错误,不幸的是app_name已经停止了消息

时间:2017-01-02 18:08:41

标签: xamarin mono xamarin.android xamarin.forms xamarin-studio

爵士  我是xamarin的新手。我在xamarin的visual studio 2015的帮助下创建了一个Android应用程序。当我在模拟器或设备上部署时,它会显示错误消息“不幸的应用程序已停止”。 当我显示我的输出窗口时,它会显示一些错误。

01-02 12:57:49.804 D/Mono    ( 1931): DllImport searching in: '__Internal' ('(null)').
01-02 12:57:49.804 D/Mono    ( 1931): Searching for 'java_interop_jnienv_call_static_int_method_a'.
01-02 12:57:49.804 D/Mono    ( 1931): Probing 'java_interop_jnienv_call_static_int_method_a'.
01-02 12:57:49.804 D/Mono    ( 1931): Found as 'java_interop_jnienv_call_static_int_method_a'.
Unhandled Exception:

System.NullReferenceException: Object reference not set to an instance of an object.

Exception:

System.NullReferenceException: Object reference not set to an instance of an object.

01-02 12:57:56.994 D/Mono    ( 1931): DllImport attempting to load: '/system/lib/liblog.so'.
01-02 12:57:57.004 D/Mono    ( 1931): DllImport loaded library '/system/lib/liblog.so'.
01-02 12:57:57.004 D/Mono    ( 1931): DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
01-02 12:57:57.014 D/Mono    ( 1931): Searching for '__android_log_print'.
01-02 12:57:57.014 D/Mono    ( 1931): Probing '__android_log_print'.
01-02 12:57:57.014 D/Mono    ( 1931): Found as '__android_log_print'.
01-02 12:57:57.094 I/MonoDroid( 1931): UNHANDLED EXCEPTION:
01-02 12:57:57.184 I/MonoDroid( 1931): System.NullReferenceException: Object reference not set to an instance of an object.
01-02 12:57:57.194 I/MonoDroid( 1931):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage (Xamarin.Forms.Page page, System.Int32 width, System.Int32 height) [0x00095] in <2a052f3b56384a10a64739174b087326>:0 
01-02 12:57:57.194 I/MonoDroid( 1931):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0000a] in <2a052f3b56384a10a64739174b087326>:0 
01-02 12:57:57.204 I/MonoDroid( 1931):   at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0000e] in <2a052f3b56384a10a64739174b087326>:0 
01-02 12:57:57.204 I/MonoDroid( 1931):   at Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00009] in /Users/builder/data/lanes/3511/ce955cc0/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3427 
01-02 12:57:57.214 I/MonoDroid( 1931):   at (wrapper dynamic-method) System.Object:d7331965-48ad-43af-8d8d-0b763526f638 (intptr,intptr,bool,int,int,int,int)
01-02 12:57:57.434 D/Mono    ( 1931): Image addref System.ServiceModel.Internals[0xb967a8e0] -> System.ServiceModel.Internals.dll[0xb9673a00]: 1
01-02 12:57:57.434 D/Mono    ( 1931): Assembly System.ServiceModel.Internals[0xb967a8e0] added to domain RootDomain, ref_count=1
01-02 12:57:57.444 D/Mono    ( 1931): AOT module 'System.ServiceModel.Internals.dll.so' not found: dlopen failed: library "/data/app-lib/OM.Droid-1/libaot-System.ServiceModel.Internals.dll.so" not found
01-02 12:57:57.444 D/Mono    ( 1931): AOT module '/Users/builder/data/lanes/3511/77cb8568/source/monodroid/builds/install/mono-armv7/lib/mono/aot-cache/arm/System.ServiceModel.Internals.dll.so' not found: dlopen failed: library "/data/app-lib/OM.Droid-1/libaot-System.ServiceModel.Internals.dll.so" not found
01-02 12:57:57.444 D/Mono    ( 1931): Config attempting to parse: 'System.ServiceModel.Internals.dll.config'.
01-02 12:57:57.444 D/Mono    ( 1931): Config attempting to parse: '/Users/builder/data/lanes/3511/77cb8568/source/monodroid/builds/install/mono-armv7/etc/mono/assemblies/System.ServiceModel.Internals/System.ServiceModel.Internals.config'.
01-02 12:57:57.444 D/Mono    ( 1931): Assembly Ref addref System.Runtime.Serialization[0xb94c0798] -> System.ServiceModel.Internals[0xb967a8e0]: 2
01-02 12:57:57.454 D/Mono    ( 1931): Assembly Ref addref System.ServiceModel.Internals[0xb967a8e0] -> mscorlib[0xb87fcd58]: 37
Loaded assembly: System.ServiceModel.Internals.dll [External]
01-02 12:57:57.514 D/Mono    ( 1931): DllImport searching in: '__Internal' ('(null)').
01-02 12:57:57.524 D/Mono    ( 1931): Searching for 'java_interop_jnienv_throw'.
01-02 12:57:57.524 D/Mono    ( 1931): Probing 'java_interop_jnienv_throw'.
01-02 12:57:57.524 D/Mono    ( 1931): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.

01-02 12:57:59.904 E/mono    ( 1931): 
01-02 12:57:59.904 E/mono    ( 1931): Unhandled Exception:
01-02 12:57:59.904 E/mono    ( 1931): System.NullReferenceException: Object reference not set to an instance of an object.
01-02 12:57:59.904 E/mono-rt ( 1931): [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.
In mgmain JNI_OnLoad

我的代码: - 这在我的Android应用中使用...,

[Activity(Label = "OM", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());

        }
    }

0 个答案:

没有答案