应用程序不能在android中高于4.1的版本上运行

时间:2014-11-05 10:29:30

标签: android version

我的应用程序在4.1及以下版本中运行良好。但是当尝试在更高版本上测试它时它会一直崩溃。主要是当按钮用于调用新活动时。 在我的清单中使用权限如下

<uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

我是Android的新手,这是我的第一个应用程序,请帮我搞清楚。提前谢谢。

编辑我的logcat如下。希望这有帮助。

11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:45.933: E/lights(672): write_led_info failed to open -1
11-06 12:49:46.623: E/videowall-TranscodeReceiver(9272): broadcastMSG : android.intent.action.SCREEN_ON
11-06 12:49:46.643: E/vwengine(9272): stopTranscoding
11-06 12:49:48.353: E/SMD(275): DCD OFF
11-06 12:49:50.323: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:50.863: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:51.353: E/SMD(275): DCD OFF
11-06 12:49:51.393: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:52.193: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:52.673: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:54.363: E/SMD(275): DCD OFF
11-06 12:49:55.083: E/AudioResampler(266): Unsupported sample format, 1 bits, 2 channels
11-06 12:49:56.373: E/DatabaseUtils(672): Writing exception to parcel
11-06 12:49:56.373: E/DatabaseUtils(672): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
11-06 12:49:56.373: E/DatabaseUtils(672):   at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13292)
11-06 12:49:56.373: E/DatabaseUtils(672):   at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2058)
11-06 12:49:56.373: E/DatabaseUtils(672):   at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:615)
11-06 12:49:56.373: E/DatabaseUtils(672):   at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
11-06 12:49:56.373: E/DatabaseUtils(672):   at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
11-06 12:49:56.373: E/DatabaseUtils(672):   at android.os.Binder.execTransact(Binder.java:388)
11-06 12:49:56.373: E/DatabaseUtils(672):   at dalvik.system.NativeStart.run(Native Method)
11-06 12:49:56.433: E/dbadapter(13552): ***********Database Created*****************
11-06 12:49:57.363: E/SMD(275): DCD OFF
11-06 12:49:57.573: E/TypeFaces(13552): Typeface not loaded.
11-06 12:49:57.583: E/TypeFaces(13552): Typeface not loaded.
11-06 12:49:58.983: E/EnterpriseContainerManager(672): ContainerPolicy Service is not yet ready!!!
11-06 12:50:00.363: E/SMD(275): DCD OFF
11-06 12:50:01.423: E/DatabaseUtils(672): Writing exception to parcel
11-06 12:50:01.423: E/DatabaseUtils(672): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
11-06 12:50:01.423: E/DatabaseUtils(672):   at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13292)
11-06 12:50:01.423: E/DatabaseUtils(672):   at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2058)
11-06 12:50:01.423: E/DatabaseUtils(672):   at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:615)
11-06 12:50:01.423: E/DatabaseUtils(672):   at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
11-06 12:50:01.423: E/DatabaseUtils(672):   at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
11-06 12:50:01.423: E/DatabaseUtils(672):   at android.os.Binder.execTransact(Binder.java:388)
11-06 12:50:01.423: E/DatabaseUtils(672):   at dalvik.system.NativeStart.run(Native Method)
11-06 12:50:01.773: E/dalvikvm-heap(13552): Out of memory on a 28702816-byte allocation.
11-06 12:50:01.803: E/AndroidRuntime(13552): FATAL EXCEPTION: main
11-06 12:50:01.803: E/AndroidRuntime(13552): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.application1/com.example.application1.CreateSlideActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2308)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread.access$700(ActivityThread.java:168)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.os.Looper.loop(Looper.java:176)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread.main(ActivityThread.java:5493)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at java.lang.reflect.Method.invokeNative(Native Method)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at java.lang.reflect.Method.invoke(Method.java:525)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1225)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1041)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at dalvik.system.NativeStart.main(Native Method)
11-06 12:50:01.803: E/AndroidRuntime(13552): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.createView(LayoutInflater.java:669)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:718)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.inflate(LayoutInflater.java:382)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.Activity.setContentView(Activity.java:1956)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at com.example.application1.CreateSlideActivity.onCreate(CreateSlideActivity.java:187)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.Activity.performCreate(Activity.java:5372)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
11-06 12:50:01.803: E/AndroidRuntime(13552):    ... 11 more
11-06 12:50:01.803: E/AndroidRuntime(13552): Caused by: java.lang.reflect.InvocationTargetException
11-06 12:50:01.803: E/AndroidRuntime(13552):    at java.lang.reflect.Constructor.constructNative(Native Method)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.LayoutInflater.createView(LayoutInflater.java:643)
11-06 12:50:01.803: E/AndroidRuntime(13552):    ... 23 more
11-06 12:50:01.803: E/AndroidRuntime(13552): Caused by: java.lang.OutOfMemoryError
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:586)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:439)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.content.res.Resources.loadDrawable(Resources.java:2988)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.View.<init>(View.java:3564)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.View.<init>(View.java:3493)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.view.ViewGroup.<init>(ViewGroup.java:469)
11-06 12:50:01.803: E/AndroidRuntime(13552):    at android.widget.RelativeLayout.<init>(RelativeLayout.java:242)
11-06 12:50:01.803: E/AndroidRuntime(13552):    ... 26 more
11-06 12:50:02.133: E/android.os.Debug(672): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
11-06 12:50:03.363: E/SMD(275): DCD OFF

1 个答案:

答案 0 :(得分:0)

该标记与权限无关,但只是说明了最低sdk版本。您需要告诉我们崩溃发生的位置,否则没有人能够提供帮助。您可以从崩溃报告库(例如Acra(https://github.com/ACRA/acra))获取此信息,例如logcat或(我建议无论如何)。