应用程序在Galaxy S3 Mini中崩溃,但适用于其他型号

时间:2013-10-29 19:04:46

标签: c# android mono

我已经使用Visual Studio 2012和Android的mono构建了一个简单的“Hello World”应用程序。问题是该应用程序在三星Galaxy S3和LG Optymus L2中运行良好,但在Galaxy S3 mini打开时没有任何理由崩溃。所有手机都使用相同的Android版本4.1.2。我不知道问题出在哪里。这是代码,是Visual Studio生成的“Hello World”:

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace HelloWorld
{
[Activity(Label = "HelloWorld", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
    int count = 1;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        SetContentView(Resource.Layout.Main);

        Button button = FindViewById<Button>(Resource.Id.MyButton);

        button.Click += delegate { button.Text = string.Format("{0} clicks!",       count++); };
    }
}
}

编译时的Android日志:

Loaded assembly: HelloWorld.dll
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: System.Core.dll [External]
10-29 12:35:30.913 E/Trace   ( 5848): error opening trace file: No such file or       directory (2)
10-29 12:35:30.941 V/ActivityThread( 5848): Class path: /data/app /HelloWorld.HelloWorld-1.apk, JNI path: /data/data/HelloWorld.HelloWorld/lib
10-29 12:35:30.945 I/ActivityThread( 5848): Pub        HelloWorld.HelloWorld.mono.MonoRuntimeProvider.__mono_init__: mono.MonoRuntimeProvider
10-29 12:35:30.946 D/dalvikvm( 5848): Trying to load lib /data/data/HelloWorld.HelloWorld/lib/libmonodroid.so 0x422857b0
10-29 12:35:30.951 D/dalvikvm( 5848): Added shared lib /data/data/HelloWorld.HelloWorld    /lib/libmonodroid.so 0x422857b0
10-29 12:35:30.952 W/MonoDroid-Debugger( 5848): Trying to initialize the debugger with options: --debugger-
agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8889,server=y,embedding=1
10-29 12:35:31.062 W/MonoDroid-Debugger( 5848): Accepted stdout connection: 42
10-29 12:35:32.136 W/monodroid-gc( 5848): GREF GC Threshold: 46800
Loaded assembly: MonoDroidConstructors [External]
10-29 12:35:33.296 I/SurfaceTextureClient( 5848): [void android::SurfaceTextureClient::init()] debug.stc.fps: 3000 ms
10-29 12:35:33.300 D/libEGL  ( 5848): loaded /vendor/lib/egl/libEGL_mtk.so
10-29 12:35:33.304 D/libEGL  ( 5848): loaded /vendor/lib/egl/libGLESv1_CM_mtk.so
10-29 12:35:33.310 D/libEGL  ( 5848): loaded /vendor/lib/egl/libGLESv2_mtk.so
10-29 12:35:33.342 E/MMUMapper( 5848): fail to register MVA, unsupported format(0x5)
10-29 12:35:33.343 D/OpenGLRenderer( 5848): Enabling debug mode 0
10-29 12:35:33.396 E/MMUMapper( 5848): fail to register MVA, unsupported format(0x5)
10-29 12:35:37.452 D/VelocityTracker( 5848): Couldn't open '/dev/touch' (No such file or directory)
10-29 12:35:37.461 D/VelocityTracker( 5848): tpd read x fail: Bad file number
10-29 12:35:37.462 D/VelocityTracker( 5848): tpd read y fail: Bad file number
10-29 12:35:37.474 I/SurfaceTextureClient( 5848): [0x53cf7038] frames:2, duration:4.086000, fps:0.489472
10-29 12:35:37.482 E/MMUMapper( 5848): fail to register MVA, unsupported format(0x5)
10-29 12:35:37.490 V/Provider/Setting( 5848): invalidate [system]: current 58 != cached 0
10-29 12:35:37.492 V/Provider/Setting( 5848): from db cache, name = sound_effects_enabled value = 1
10-29 12:35:37.743 V/Provider/Setting( 5848): from settings cache , name = sound_effects_enabled value = 1
10-29 12:35:38.147 V/Provider/Setting( 5848): from settings cache , name = sound_effects_enabled value = 1

任何人都知道可能是什么?

由于

1 个答案:

答案 0 :(得分:1)

我回答我自己的问题:

还有另外一个问题,就是我无法调试那个型号手机,因为没有它,但是在获得一个后,我发现问题要容易得多。只是手机无法找到资源分辨率的正确图像,因为它不存在。我创造了图像,一切都很完美。

我认为如果我在模拟器中回复模型手机,我可以更快地解决问题。