2 kiaonly kiaonly 于 2014.08.08 10:44 提问

安卓插件开发报错 You must supply a layout_height attribute.

将一个编译好的apk放到sd卡中作为插件,然后让另外一个APK动态去加载,但是当在三星手机上运行时会报如下错误,可以确定插件apk的layout每个layout_height 属性都设置了,而且滴31行的XML不是layout_height属性:
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): java.lang.reflect.InvocationTargetException
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at java.lang.reflect.Method.invokeNative(Native Method)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at java.lang.reflect.Method.invoke(Method.java:511)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.box.android.library.activity.ProxyActivity.launchTargetActivity(ProxyActivity.java:146)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.box.android.library.activity.ProxyActivity.launchTargetActivity(ProxyActivity.java:102)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.box.android.library.activity.ProxyActivity.onCreate(ProxyActivity.java:87)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.box.android.smarthome.activity.plugin.PluginDialogActivity.onCreate(PluginDialogActivity.java:33)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.Activity.performCreate(Activity.java:5206)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.ActivityThread.access$700(ActivityThread.java:140)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.os.Handler.dispatchMessage(Handler.java:99)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.os.Looper.loop(Looper.java:137)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.ActivityThread.main(ActivityThread.java:4946)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at java.lang.reflect.Method.invokeNative(Native Method)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at java.lang.reflect.Method.invoke(Method.java:511)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1036)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:803)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at dalvik.system.NativeStart.main(Native Method)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): Caused by: java.lang.RuntimeException: Binary XML file line #31: You must supply a layout_height attribute.
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5702)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:5837)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.widget.LinearLayout$LayoutParams.(LinearLayout.java:1815)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1727)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.LayoutInflater.rInflate(LayoutInflater.java:748)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at android.app.Activity.setContentView(Activity.java:1924)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.box.android.library.plugin.activity.BasePluginActivity.setContentView(BasePluginActivity.java:217)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): at com.android.mio.wd.MiotWenShiActivity.onCreate(MiotWenShiActivity.java:84)
08-08 10:39:41.683: E/ProxyActivity.launchTargetActivity(L:150)(26565): ... 20 more

Csdn user default icon
上传中...
上传图片
插入图片