私は自分のアプリで画像ビューを使用すると、Android 2.2を搭載した銀河やバージョン2.1のエミュレータでうまく動作します。& 2.2 しかし、私はそれを私の電話機で起動します(xperia X10 mini pro with android 2.1)それはクラッシュする 問題は明らかにイメージビューからです。 しかし、私はどこを見ることができません。 はここに私のコードのXMLimageview android 2.1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
>
<ImageView
android:id="@+id/logo"
android:src="@drawable/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
>
</ImageView>
<TextView
android:id="@+id/espace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello"
android:layout_gravity="center_horizontal"
/>
</LinearLayout>
はここlogcatだだ:
02-28 10:55:32.833 I/ActivityManager(1214): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ecovalim/.startEco }
02-28 10:55:32.923 I/ActivityManager(1214): Start proc com.ecovalim for activity com.ecovalim/.startEco: pid=10784 uid=10087 gids={3003, 1015}
02-28 10:55:33.053 W/ResourceType(10784): Failure getting entry for 0x7f020015 (t=1 e=21) in package 0: 0xffffffb5
02-28 10:55:33.063 D/AndroidRuntime(10784): Shutting down VM
02-28 10:55:33.063 W/dalvikvm(10784): threadid=3: thread exiting with uncaught exception (group=0x40026160)
02-28 10:55:33.063 E/AndroidRuntime(10784): Uncaught handler: thread main exiting due to uncaught exception
02-28 10:55:33.093 E/AndroidRuntime(10784): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ecovalim/com.ecovalim.startEco}: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2503)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.access$2200(ActivityThread.java:123)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.os.Handler.dispatchMessage(Handler.java:99)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.os.Looper.loop(Looper.java:123)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.main(ActivityThread.java:4370)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Method.invokeNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Method.invoke(Method.java:521)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-28 10:55:33.093 E/AndroidRuntime(10784): at dalvik.system.NativeStart.main(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class android.widget.ImageView
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.Activity.setContentView(Activity.java:1625)
02-28 10:55:33.093 E/AndroidRuntime(10784): at com.ecovalim.startEco.onCreate(startEco.java:30)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 11 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: java.lang.reflect.InvocationTargetException
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.widget.ImageView.<init>(ImageView.java:109)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Constructor.constructNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 22 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-ldpi/title_bar_shadow.9.png from drawable resource ID #0x7f020015
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.Resources.loadDrawable(Resources.java:1710)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.TypedArray.getDrawable(TypedArray.java:548)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.widget.ImageView.<init>(ImageView.java:119)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 26 more
02-28 10:55:33.093 E/AndroidRuntime(10784): Caused by: java.io.FileNotFoundException: res/drawable-ldpi/title_bar_shadow.9.png
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.AssetManager.openNonAssetNative(Native Method)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.AssetManager.openNonAsset(AssetManager.java:390)
02-28 10:55:33.093 E/AndroidRuntime(10784): at android.content.res.Resources.loadDrawable(Resources.java:1702)
02-28 10:55:33.093 E/AndroidRuntime(10784): ... 28 more
02-28 10:55:33.113 E/SemcCheckin(10784): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
02-28 10:55:33.113 W/ActivityManager(1214): Unable to start service Intent { act=com.sonyericsson.android.jcrashcatcher.action.BUGREPORT_AUTO cmp=com.sonyericsson.android.jcrashcatcher/.JCrashCatcherService (has extras) }: not found
02-28 10:55:33.153 I/Process (1214): Sending signal. PID: 10784 SIG: 3
02-28 10:55:33.153 I/dalvikvm(10784): threadid=7: reacting to signal 3
02-28 10:55:33.163 I/dalvikvm(10784): Wrote stack trace to '/data/anr/traces.txt'
02-28 10:55:33.223 E/SemcCheckin(6866): Get Crash Level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
02-28 10:55:34.793 I/Process (10784): Sending signal. PID: 10784 SIG: 9
02-28 10:55:34.793 I/ActivityManager(1214): Process com.ecovalim (pid 10784) has died.
02-28 10:55:34.803 I/UsageStats(1214): Unexpected resume of com.sonyericsson.homescreen while already resumed in com.ecovalim
02-28 10:55:34.833 W/InputManagerService(1214): Window already focused, ignoring focus gain of: [email protected]
02-28 10:55:35.643 I/ActivityManager(1214): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.nolanlawson.logcat/.LogcatActivity }
02-28 10:55:35.803 I/ActivityManager(1214): Displayed activity com.nolanlawson.logcat/.LogcatActivity: 130 ms (total 2921 ms)
02-28 10:55:36.043 D/dalvikvm(10689): GC freed 4019 objects/330232 bytes in 79ms
02-28 10:55:36.433 D/dalvikvm(10689): GC freed 14022 objects/1069568 bytes in 86ms
02-28 10:55:36.723 D/dalvikvm(10689): GC freed 5244 objects/476048 bytes in 71ms
02-28 10:55:37.033 D/dalvikvm(10689): GC freed 5325 objects/460208 bytes in 84ms
02-28 10:55:37.333 D/dalvikvm(10689): GC freed 4784 objects/474496 bytes in 81ms
ことができますLogCarエラーを表示してください。 –
logcatを追加しました。あまりにも多すぎるかもしれません。私はそれ以前に使用していませんでしたので、何が相対的で何がわからないのですか? –
res/drawable-ldpi/title_bar_shadow.9 PNG? logcatのエラーはあなたが何かを見逃していると思うようになります! – caiocpricci2