0

我为尝试更改屏幕布局的输入法反编译了 .apk。我想要的更改在 Nexus 10 上成功,但我的 Nexus 4 在 logcat 中出现以下错误而崩溃。如何判断是哪个确切的 .xml 文件导致了错误?实际上有数百个 .xml 文件,它们都是意大利面条式的相互引用。

E/AndroidRuntime( 5344): FATAL EXCEPTION: main
E/AndroidRuntime( 5344): java.lang.RuntimeException: Binary XML file line #5: You must     supply a layout_width attribute.
E/AndroidRuntime( 5344):    at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
E/AndroidRuntime( 5344):    at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5819)
E/AndroidRuntime( 5344):    at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:5988)
E/AndroidRuntime( 5344):    at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1831)
E/AndroidRuntime( 5344):    at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1743)
E/AndroidRuntime( 5344):    at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:757)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:839)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
E/AndroidRuntime( 5344):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
E/AndroidRuntime( 5344):    at gp.a(SourceFile:82)
E/AndroidRuntime( 5344):    at com.google.android.apps.inputmethod.libs.framework.keyboard.KeyboardViewHelper.a(SourceFile:144)
E/AndroidRuntime( 5344):    at com.google.android.apps.inputmethod.libs.framework.keyboard.Keyboard.getBodyView(SourceFile:154)
E/AndroidRuntime( 5344):    at com.google.android.apps.inputmethod.libs.framework.keyboard.KeyboardSnapshotTaker.a(SourceFile:173)
E/AndroidRuntime( 5344):    at com.google.android.apps.inputmethod.libs.framework.keyboard.Dashboard.onKeyboardReady(SourceFile:160)
E/AndroidRuntime( 5344):    at com.google.android.apps.inputmethod.libs.framework.core.InputBundle.a(SourceFile:33)
E/AndroidRuntime( 5344):    at dO.onKeyboardDefReady(SourceFile:224)
E/AndroidRuntime( 5344):    at ed.a(SourceFile:84)
E/AndroidRuntime( 5344):    at ed.onPostExecute(SourceFile:65)
E/AndroidRuntime( 5344):    at android.os.AsyncTask.finish(AsyncTask.java:631)
E/AndroidRuntime( 5344):    at android.os.AsyncTask.access$600(AsyncTask.java:177)
E/AndroidRuntime( 5344):    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
E/AndroidRuntime( 5344):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5344):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 5344):    at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime( 5344):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5344):    at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 5344):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime( 5344):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime( 5344):    at dalvik.system.NativeStart.main(Native Method)
4

1 回答 1

1

很确定 lint 应该能捕捉到这样的错误。您可以将它用作命令行工具或从 Eclipse 中使用。

于 2013-09-21T15:33:38.147 回答