내 타블렛에서 제대로 작동하지만 내 Samsung Galaxy Ace에서는 멈출 수있는 앱을 만들었습니다. LogCat을 실행할 때 다음 로그를받습니다.VFY : 데드 코드 0x001b-001c getDisplayWidth 및 android.view.InflateException
나는 도움을 간절히 바란다.
I/DefContainer(6430): Copied /mnt/sdcard/apps/ketekambioFull.apk to /mnt/asec/smdl2tmp1/pkg.apk D/MountService(1492): :::: renameSecureContainer :: path = /mnt/sdcard, oldId = smdl2tmp1, newId = com.mydom.mypackage-1 D/VoldCmdListener(1319): asec rename smdl2tmp1 com.mydom.mypackage-1 D/MountService(1492): :::: isSecureContainerMounted :: path = /mnt/sdcard, id = com.mydom.mypackage-1 W/PackageManager(1492): Mounting container com.mydom.mypackage-1 D/MountService(1492): :::: mountSecureContainer :: path = /mnt/sdcard, id = com.mydom.mypackage-1, ownerUid = 1000 D/VoldCmdListener(1319): asec mount com.mydom.mypackage-1 {} 1000 D/Vold (1319): Fat::doMount mount(/dev/block/dm-2, /mnt/asec/com.mydom.mypackage-1,vfat,0x00200087,utf8,uid=1000,gid=0,fmask=222,dmask=222,shortname=mixed) I/PackageManager(1492): Succesfully renamed smdl2tmp1 to com.mydom.mypackage-1 at new path: /mnt/asec/com.mydom.mypackage-1 D/MountService(1492): :::: getSecureContainerPath :: path = /mnt/sdcard, id = com.mydom.mypackage-1 D/VoldCmdListener(1319): asec path com.mydom.mypackage-1 D/MountService(1492): :::: isSecureContainerMounted :: path = /mnt/sdcard, id = com.mydom.mypackage-1 I/Z7BroadcastReceiver(4649): onReceive() start, intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.mydom.mypackage flg=0x10000000 cmp=com.seven.Z7/.service.Z7BroadcastReceiver (has extras) } D/Launcher.SWidgetPkgMgr(1585): addPackage=com.mydom.mypackage V/PackageIntentReceiver(4603): onReceive() intent:Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.mydom.mypackage flg=0x10000000 cmp=com.sec.android.app.controlpanel/.PackageIntentReceiver (has extras) } pkg:com.mydom.mypackage action:android.intent.action.PACKAGE_ADDED I/ActivityManager(1492): Start proc com.mydom.mypackage for activity com.mydom.mypackage/.SplashScreenActivity: pid=6501 uid=10080 gids={} W/ActivityManager(1492): Trying to launch com.mydom.mypackage/.ActivityJuego D/dalvikvm(6501): VFY: dead code 0x001b-001c in Lcom/corral/keteKambio/ActivityJuego;.getDisplayWidth (Landroid/content/Context;)I D/dalvikvm(6501): VFY: dead code 0x002e-0034 in Lcom/corral/keteKambio/Visor;. (Landroid/content/Context;)V D/dalvikvm(6501): VFY: dead code 0x002e-0034 in Lcom/corral/keteKambio/Visor;. (Landroid/content/Context;Landroid/util/AttributeSet;)V D/dalvikvm(6501): VFY: dead code 0x002e-0034 in Lcom/corral/keteKambio/Visor;. (Landroid/content/Context;Landroid/util/AttributeSet;I)V E/AndroidRuntime(6501): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mydom.mypackage/com.mydom.mypackage.ActivityJuego}: android.view.InflateException: Binary XML file line #69: Error inflating class com.mydom.mypackage.Visor E/AndroidRuntime(6501): Caused by: android.view.InflateException: Binary XML file line #69: Error inflating class com.mydom.mypackage.Visor E/AndroidRuntime(6501): at com.mydom.mypackage.ActivityJuego.onCreate(ActivityJuego.java:101) E/AndroidRuntime(6501): at com.mydom.mypackage.Visor.(Visor.java:87) W/ActivityManager(1492): Force finishing activity com.mydom.mypackage/.ActivityJuego W/ActivityManager(1492): Activity pause timeout for HistoryRecord{40849d30 com.mydom.mypackage/.ActivityJuego} D/VoldCmdListener(1319): CommandListener::AsecCmd::runCommand -> com.mydom.mypackage-1 E/InputDispatcher(1492): channel '407a6fa8 com.mydom.mypackage/com.mydom.mypackage.SplashScreenActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8 E/InputDispatcher(1492): channel '407a6fa8 com.mydom.mypackage/com.mydom.mypackage.SplashScreenActivity (server)' ~ Channel is unrecoverably broken and will be disposed! I/WindowManager(1492): WIN DEATH: Window{407a6fa8 com.mydom.mypackage/com.mydom.mypackage.SplashScreenActivity paused=true} W/ActivityManager(1492): Activity destroy timeout for HistoryRecord{40ab1d68 com.mydom.mypackage/.SplashScreenActivity} W/ActivityManager(1492): Activity destroy timeout for HistoryRecord{40849d30 com.mydom.mypackage/.ActivityJuego}
내 타블렛에서 작동하는 이유는 모르지만 휴대 전화에서는 삼성 갤럭시 에이스가 아닙니다. 다른 상대 링크를 읽는 것을 이해하는 것을 강조했습니다.
로그는 XML의 # 69 행이 inflateException을 유발 함을 나타냅니다. 다음에이 파일을 보여줍니다. 문제는 SurfaceView 인 Visor 클래스를 부 풀리는 것입니다. 나는 또한 VFY : 0x001b-001c 데드 코드를 얻었고 메인 오류인지 모릅니다. VFY : 데드 코드 또는 InflateException?
ActivityJuego.xml :
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/TableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:stretchColumns="3"
tools:context=".MainActivity" >
...
...
...
...
<LinearLayout
android:id="@+id/LinearLayoutVistaCliente"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/borde"
android:padding="1dp"
android:paddingLeft="1dp"
android:paddingTop="1dp"
android:paddingRight="1dp"
android:paddingBottom="1dp">
<com.mydom.mypackage.Visor
android:id="@+id/visorCliente"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.0" />
</LinearLayout>
...
...
...
...
</TableLayout>
ActivityJuego.java
package com.mydom.mypackage;
public class ActivityJuego extends Activity {
public static int nivel = 1;
private Visor visorCliente;
private Visor visorCaja;
private static Typeface myTypeface;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getDisplayWidth(this) <= 720) {
smallScreen = true;
requestWindowFeature(Window.FEATURE_NO_TITLE);
}
setContentView(R.layout.activity_juego);
visorCliente = (Visor) findViewById(R.id.visorCliente);
visorCaja = (Visor) findViewById(R.id.visorCaja);
myTypeface = Typeface.createFromAsset(this.getAssets(), "LCD.ttf");
}
...
...
...
...
}
그리고 마지막으로,
Visor.java
package com.mydom.mypackage;
public class Visor extends SurfaceView implements SurfaceHolder.Callback {
BitmapFactory.Options opts = new BitmapFactory.Options();
...
...
...
public Visor(Context context) {
super(context);
getHolder().addCallback(this);
opts.inMutable=true;
}
public Visor(Context context, AttributeSet attrs) {
super(context, attrs);
getHolder().addCallback(this);
opts.inMutable=true;
}
public Visor(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
getHolder().addCallback(this);
opts.inMutable=true;
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawColor(Color.WHITE);
if (caja != null) {
draw(caja, canvas);
}
}
...
...
...
...
}
미리 감사드립니다.
getDisplayWidth()는 어디에 있나요? –
'getHolder()'란 무엇입니까? –
getDisplayWidth는 onCreate 메소드 내부의 ActivityJuego 클래스에 있습니다. – user3739361