Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

打过补丁后启动应用时 crash #190

Open
twiceyuan opened this issue Dec 20, 2016 · 10 comments
Open

打过补丁后启动应用时 crash #190

twiceyuan opened this issue Dec 20, 2016 · 10 comments

Comments

@twiceyuan
Copy link

twiceyuan commented Dec 20, 2016

机型
小米2S,Android 6.0.1 AOSP

完整日志

E/Amigo: #onCreate working checksum: 
D/Amigo: #onCreate Patch apk doesn't exists
D/AmigoDirs: clear:
I/ActivityManager: Start proc 13465:[packageName]:amigo/u0a105 for service [packageName]/me.ele.amigo.AmigoService
E/Amigo: #onCreate working checksum: 2189903949
E/Amigo: #onCreate working checksum: 2189903949
E/Amigo: #onCreate load dex process
D/AmigoDirs: deletePatchExceptApk: 2189903949
E/Amigo: layoutName-->activity_patching, themeName-->AppTheme
E/Amigo: layoutId-->2130968653, themeId-->2131361940
D/AmigoService: onHandleIntent: Intent { act=restart_main_process cmp=[packageName]/me.ele.amigo.AmigoService }
D/AmigoService: onBind: Intent { act=release_dex cmp=[packageName]/me.ele.amigo.AmigoService (has extras) }
D/AmigoService: onHandleIntent: Intent { act=release_dex cmp=[packageName]/me.ele.amigo.AmigoService (has extras) }
D/AmigoService: handleMsg: send message out to client[112233]
D/AmigoService: handleMessage: get msg from amigo service process : { when=0 what=112233 target=android.os.Handler }
D/AmigoService: handleMessage: unbind connection
D/AmigoService: onUnbind: Intent { act=release_dex cmp=[packageName]/me.ele.amigo.AmigoService (has extras) }
E/Amigo: release apk once
I/Amigo: hook Resources success
D/Amigo: installAndHook: there is no any new activity, skip hooking instrumentation & mH's callback
I/Amigo: installHookFactory success
W/System.err:     at me.ele.amigo.Amigo.runPatchedApplication(Amigo.java:338)
W/System.err:     at me.ele.amigo.Amigo.installAndHook(Amigo.java:166)
W/System.err:     at me.ele.amigo.Amigo.runPatchApk(Amigo.java:122)
W/System.err:     at me.ele.amigo.Amigo.onCreate(Amigo.java:84)
E/AndroidRuntime: FATAL EXCEPTION: AmigoSdk
                  Process: [packageName], PID: 13484
                  java.lang.NullPointerException: Attempt to read from field 'int android.content.pm.PackageInfo.versionCode' on a null object reference
                      at me.ele.amigo.hook.IPackageManagerHookHandle$getPackageInfo.afterInvoke(IPackageManagerHookHandle.java:93)
                      at me.ele.amigo.hook.HookedMethodHandler.doHookInner(HookedMethodHandler.java:38)
                      at me.ele.amigo.hook.ProxyHook.invoke(ProxyHook.java:31)
                      at java.lang.reflect.Proxy.invoke(Proxy.java:393)
                      at $Proxy1.getPackageInfo(Unknown Source)
                      at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:129)
                      at me.ele.amigo.utils.PermissionChecker.checkPatchPermission(PermissionChecker.java:25)
                      at me.ele.amigo.PatchChecker.checkPatchApk(PatchChecker.java:46)
                      at me.ele.amigo.PatchChecker.checkPatchAndCopy(PatchChecker.java:25)
                      at me.ele.amigo.Amigo.work(Amigo.java:394)
                      at me.ele.amigo.Amigo.work(Amigo.java:386)
                      at me.ele.amigo.sdk.AmigoSdk.applyPatchApk(AmigoSdk.java:220)
                      at me.ele.amigo.sdk.AmigoSdk.access$800(AmigoSdk.java:33)
                      at me.ele.amigo.sdk.AmigoSdk$2.onSucc(AmigoSdk.java:132)
                      at me.ele.amigo.sdk.http.Http$1$3.run(Http.java:132)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.os.HandlerThread.run(HandlerThread.java:61)
@JackCho
Copy link
Contributor

JackCho commented Dec 20, 2016

这个问题前面修复了,你check一下你使用的是否是最新版本

classpath 'me.ele:amigo:0.6.2'

@twiceyuan
Copy link
Author

twiceyuan commented Dec 20, 2016

你好,我已经升级到 0.6.2 了,gradle console 中也会打印日志 amigo plugin version: 0.6.2,但还是会报这个错误。

下面是更完整的日志,不知道有没有帮助:

I/art: Late-enabling -Xcheck:jni
E/Amigo: #onCreate working checksum: 546459436
E/amigo_patch_cleaner: clear without patch
D/AmigoDirs: deletePatchExceptApk: 546459436
E/Amigo: layoutName-->activity_patching, themeName-->AppTheme
E/Amigo: layoutId-->2130968653, themeId-->2131361940
E/Amigo: release apk once
W/System: ClassLoader referenced unknown path: 
I/Amigo: hook Resources success
D/Amigo: installAndHook: there is no any new activity, skip hooking instrumentation & mH's callback
I/IActivityManagerHook: Install ActivityManager Hook 2 old=android.app.ActivityManagerProxy@155fa42,new=android.app.ActivityManagerProxy@155fa42
E/IActivityManagerHook: Install ActivityManager 3 Hook  old=android.app.ActivityManagerProxy@155fa42,new=android.app.ActivityManagerProxy@155fa42
I/Amigo: installHookFactory success
I/MultiDex: VM with version 2.1.0 has multidex support
I/MultiDex: install
I/MultiDex: VM has multidex support, MultiDex support library is disabled.
D/HookedMethodHandler: doHookInner beforeInvoke cost 3 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
D/HookedMethodHandler: doHookInner afterInvoke cost 18 ms
D/ProxyHook: invoking (public abstract android.content.pm.ApplicationInfo android.content.pm.IPackageManager.getApplicationInfo(java.lang.String,int,int) throws android.os.RemoteException) 
             cost 22 ms totally
W/System: ClassLoader referenced unknown path: /system/framework/tcmclient.jar
D/HookedMethodHandler: doHookInner beforeInvoke cost 0 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
D/HookedMethodHandler: doHookInner afterInvoke cost 0 ms
D/ProxyHook: invoking (public abstract android.content.pm.ApplicationInfo android.content.pm.IPackageManager.getApplicationInfo(java.lang.String,int,int) throws android.os.RemoteException) 
             cost 1 ms totally
I/stetho: Listening on @stetho_[packageName]_devtools_remote
D/HookedMethodHandler: doHookInner beforeInvoke cost 0 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
D/HookedMethodHandler: doHookInner afterInvoke cost 0 ms
D/ProxyHook: invoking (public abstract android.content.pm.PackageInfo android.content.pm.IPackageManager.getPackageInfo(java.lang.String,int,int) throws android.os.RemoteException) 
             cost 2 ms totally
I/WebViewFactory: Loading com.android.webview version 44.0.2403.119 (code 246011900)
D/HookedMethodHandler: doHookInner beforeInvoke cost 0 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
D/HookedMethodHandler: doHookInner afterInvoke cost 0 ms
D/ProxyHook: invoking (public abstract android.content.pm.ApplicationInfo android.content.pm.IPackageManager.getApplicationInfo(java.lang.String,int,int) throws android.os.RemoteException) 
             cost 1 ms totally
W/System: ClassLoader referenced unknown path: /system/app/webview/lib/arm
I/LibraryLoader: Time to load native libraries: 4 ms (timestamps 7336-7340)
I/LibraryLoader: Expected native library version number "",actual native library version number ""
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {21527b}
I/LibraryLoader: Expected native library version number "",actual native library version number ""
I/chromium: [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserStartupController: Initializing chromium process, singleProcess=true
W/art: Attempt to remove non-JNI local reference, dumping thread
E/SysUtils: ApplicationContext is null in ApplicationStatus
W/chromium: [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 09/02/15, 76f806e, Ibddc658e36
D/HookedMethodHandler: doHookInner beforeInvoke cost 0 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
W/asset: Asset path /data/data/[packageName]/files/amigo/patch.apk is neither a directory nor file (type=1).
W/System.err: java.lang.NullPointerException: Attempt to read from field 'int android.content.pm.PackageInfo.versionCode' on a null object reference
W/System.err:     at me.ele.amigo.hook.IPackageManagerHookHandle$getPackageInfo.afterInvoke(IPackageManagerHookHandle.java:102)
W/System.err:     at me.ele.amigo.hook.HookedMethodHandler.doHookInner(HookedMethodHandler.java:38)
W/System.err:     at me.ele.amigo.hook.ProxyHook.invoke(ProxyHook.java:31)
W/System.err:     at java.lang.reflect.Proxy.invoke(Proxy.java:393)
W/System.err:     at $Proxy1.getPackageInfo(Unknown Source)
W/System.err:     at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:129)
W/System.err:     at org.chromium.base.BuildInfo.getPackageVersionCode(BuildInfo.java:73)
W/System.err:     at org.chromium.content.app.ContentMain.nativeStart(Native Method)
W/System.err:     at org.chromium.content.app.ContentMain.start(ContentMain.java:34)
W/System.err:     at org.chromium.content.browser.BrowserStartupController.contentStart(BrowserStartupController.java:220)
W/System.err:     at org.chromium.content.browser.BrowserStartupController.startBrowserProcessesSync(BrowserStartupController.java:202)
W/System.err:     at org.chromium.android_webview.AwBrowserProcess$1.run(AwBrowserProcess.java:57)
W/System.err:     at org.chromium.base.ThreadUtils.runOnUiThreadBlocking(ThreadUtils.java:64)
W/System.err:     at org.chromium.android_webview.AwBrowserProcess.start(AwBrowserProcess.java:53)
W/System.err:     at com.android.webview.chromium.WebViewChromiumFactoryProvider.startChromiumLocked(WebViewChromiumFactoryProvider.java:258)
W/System.err:     at com.android.webview.chromium.WebViewChromiumFactoryProvider.ensureChromiumStartedLocked(WebViewChromiumFactoryProvider.java:200)
W/System.err:     at com.android.webview.chromium.WebViewChromiumFactoryProvider.getStatics(WebViewChromiumFactoryProvider.java:350)
W/System.err:     at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:1899)
W/System.err:     at [packageName].AppApplication.onCreate(AppApplication.java:101)
W/System.err:     at me.ele.amigo.Amigo.runPatchedApplication(Amigo.java:338)
W/System.err:     at me.ele.amigo.Amigo.installAndHook(Amigo.java:166)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:20)
W/System.err:     at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:49)
W/System.err:     at me.ele.amigo.Amigo.runPatchApk(Amigo.java:122)
W/System.err:     at me.ele.amigo.Amigo.onCreate(Amigo.java:84)
W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
W/System.err:     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
W/System.err:     at android.app.ActivityThread.-wrap1(ActivityThread.java)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:148)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5417)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
V/MD5: Calculated digest: 1d83f3e48bb6b8b7bcf9e95e8f7e2a02
V/MD5: Provided digest: 1d83f3e48bb6b8b7bcf9e95e8f7e2a02
D/HookedMethodHandler: doHookInner beforeInvoke cost 0 ms
I/HookedMethodHandler: doHookInner invoke cost 1 ms
W/asset: Asset path /data/data/[packageName]/files/amigo/patch.apk is neither a directory nor file (type=1).
E/MobclickAgent: java.lang.NullPointerException: Attempt to invoke virtual method 'void u.aly.ad.b(android.content.Context)' on a null object reference:  [Exception in onAppCrash]
E/MobclickAgent:     at  com.umeng.analytics.d.a(InternalAgent.java:365)
E/MobclickAgent:     at  u.aly.ag.a(CrashHandler.java:43)
E/MobclickAgent:     at  u.aly.ag.uncaughtException(CrashHandler.java:34)
E/MobclickAgent:     at  java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
E/MobclickAgent:     at  java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
E/AndroidRuntime: FATAL EXCEPTION: AmigoSdk
                  Process: [packageName], PID: 2895
                  java.lang.NullPointerException: Attempt to read from field 'int android.content.pm.PackageInfo.versionCode' on a null object reference
                      at me.ele.amigo.hook.IPackageManagerHookHandle$getPackageInfo.afterInvoke(IPackageManagerHookHandle.java:102)
                      at me.ele.amigo.hook.HookedMethodHandler.doHookInner(HookedMethodHandler.java:38)
                      at me.ele.amigo.hook.ProxyHook.invoke(ProxyHook.java:31)
                      at java.lang.reflect.Proxy.invoke(Proxy.java:393)
                      at $Proxy1.getPackageInfo(Unknown Source)
                      at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:129)
                      at me.ele.amigo.utils.PermissionChecker.checkPatchPermission(PermissionChecker.java:25)
                      at me.ele.amigo.PatchChecker.checkPatchApk(PatchChecker.java:46)
                      at me.ele.amigo.PatchChecker.checkPatchAndCopy(PatchChecker.java:25)
                      at me.ele.amigo.Amigo.work(Amigo.java:394)
                      at me.ele.amigo.Amigo.work(Amigo.java:386)
                      at me.ele.amigo.sdk.AmigoSdk.applyPatchApk(AmigoSdk.java:220)
                      at me.ele.amigo.sdk.AmigoSdk.access$800(AmigoSdk.java:33)
                      at me.ele.amigo.sdk.AmigoSdk$2.onSucc(AmigoSdk.java:132)
                      at me.ele.amigo.sdk.http.Http$1$3.run(Http.java:132)
                      at android.os.Handler.handleCallback(Handler.java:739)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:148)
                      at android.os.HandlerThread.run(HandlerThread.java:61)

@FtheGFW
Copy link
Contributor

FtheGFW commented Dec 21, 2016

请确保在 amigo 后台上传的是完整的 apk,能够被正确安装到手机上;
再麻烦升级一下 amgio

classpath 'me.ele:amigo:0.6.3'

@twiceyuan
Copy link
Author

@FtheGFW 您好,我在应用 data 目录 amigo 文件夹下发现的 patch apk 拷贝出来直接安装是正常的,更新到 0.6.3 之后依然存在该问题,错误日志和之前一样。

还有,从 data 目录下的 apk 直接安装覆盖打过补丁的应用后,启动应用时会一直处于黑屏状态,只有清除数据(应该是清除了补丁?)后才能正常打开。

@FtheGFW
Copy link
Contributor

FtheGFW commented Dec 22, 2016

那就奇怪了,看你的 stacktrace 提示的:
Asset path /data/data/[packageName]/files/amigo/patch.apk is neither a directory nor file (type=1).
应该是文件的问题啊,
另外还是需要麻烦你把更新到0.6.3后,重新打包,上传到 amigo 后台做一次完整测试,并把可能出现的完整 stacktrace 给上传一下,谢谢! @twiceyuan

@twiceyuan
Copy link
Author

twiceyuan commented Dec 22, 2016

@FtheGFW 貌似重试了几次现在可以了,之前发生的错误没搞明白怎么回事,之后如果有重现再反馈到这边吧。

不过还是有下面两点疑问:

  1. patching activity 的界面貌似很快就退出了,但是看日志好像之后过了十几秒才完成补丁,在此期间打开 app 都是没反应的。

  2. 用 demo 测试时,单次打补只有一条校验的日志,但是在我们项目中运用时,单次补丁打印了很多校验补丁的日志,这个是正常的吗,log 如下:

E/Amigo: #onCreate working checksum: 4225689984
E/me.ele.amigo.PatchChecker: savedChecksum-->3547920865, checksum--->3547920865
E/me.ele.amigo.PatchChecker: savedChecksum-->3234406638, checksum--->3234406638
E/me.ele.amigo.PatchChecker: savedChecksum-->1290252948, checksum--->1290252948
// ... 省略很多行相同的日志
E/me.ele.amigo.PatchChecker: savedChecksum-->2124039896, checksum--->2124039896

@twiceyuan
Copy link
Author

@FtheGFW 刚刚重现了之前的一种情况,发现开启 WebView 的调试也会导致打完补丁后崩溃。

具体日志如下:

E/IActivityManagerHook: Install ActivityManager 3 Hook  old=android.app.ActivityManagerProxy@aaebf4a,new=android.app.ActivityManagerProxy@aaebf4a
E/WebViewFactory: error instantiating provider
                  java.lang.reflect.InvocationTargetException
                      at java.lang.reflect.Constructor.newInstance0(Native Method)
                      at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                      at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:198)
                      at android.webkit.WebView.getFactory(WebView.java:2325)
                      at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:1943)
                      at [packageName].AppApplication.onCreate(AppApplication.java:101)
                      at me.ele.amigo.Amigo.runPatchedApplication(Amigo.java:338)
                      at me.ele.amigo.Amigo.installAndHook(Amigo.java:166)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:20)
                      at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:49)
                      at me.ele.amigo.Amigo.runPatchApk(Amigo.java:122)
                      at me.ele.amigo.Amigo.onCreate(Amigo.java:84)
                      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
                      at android.app.ActivityThread.-wrap2(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6119)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                   Caused by: java.lang.NullPointerException: Attempt to read from field 'int android.content.pm.PackageInfo.versionCode' on a null object reference
                      at me.ele.amigo.hook.IPackageManagerHookHandle$getPackageInfo.afterInvoke(IPackageManagerHookHandle.java:102)
                      at me.ele.amigo.hook.HookedMethodHandler.doHookInner(HookedMethodHandler.java:38)
                      at me.ele.amigo.hook.ProxyHook.invoke(ProxyHook.java:31)
                      at java.lang.reflect.Proxy.invoke(Proxy.java:813)
                      at $Proxy1.getPackageInfo(Unknown Source)
                      at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:139)
                      at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:132)
                      at org.chromium.base.PackageUtils.getPackageVersion(PackageUtils.java:26)
                      at com.android.webview.chromium.WebViewChromiumFactoryProvider.initialize(WebViewChromiumFactoryProvider.java:9538)
                      at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init>(WebViewChromiumFactoryProvider.java:195)
                      at java.lang.reflect.Constructor.newInstance0(Native Method) 
                      at java.lang.reflect.Constructor.newInstance(Constructor.java:430) 
                      at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:198) 
                      at android.webkit.WebView.getFactory(WebView.java:2325) 
                      at android.webkit.WebView.setWebContentsDebuggingEnabled(WebView.java:1943) 
                      at [packageName].AppApplication.onCreate(AppApplication.java:101) 
                      at me.ele.amigo.Amigo.runPatchedApplication(Amigo.java:338) 
                      at me.ele.amigo.Amigo.installAndHook(Amigo.java:166) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:20) 
                      at me.ele.amigo.reflect.MethodUtils.invokeMethod(MethodUtils.java:49) 
                      at me.ele.amigo.Amigo.runPatchApk(Amigo.java:122) 
                      at me.ele.amigo.Amigo.onCreate(Amigo.java:84) 
                      at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) 
                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403) 
                      at android.app.ActivityThread.-wrap2(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:154) 
                      at android.app.ActivityThread.main(ActivityThread.java:6119) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

@JackCho
Copy link
Contributor

JackCho commented Dec 27, 2016

问题已收到,会尽快处理。

还有打印多条日志没关系,这个是在校验so, dex, odex,所以会打印出很多条

@D-Rusty
Copy link

D-Rusty commented Sep 21, 2017

我有一个apk直接安装是可以用的,经过Amigo.work替换,应用重启后就报下面错误了,谢谢
09-21 14:14:05.788 9768-9768/com.hhly.community E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.hhly.community, PID: 9768
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hhly.community/com.hhly.community.ui.main.MainActivity}: android.view.InflateException: Binary XML file line #25: Binary XML file line #25: You must supply a layout_width attribute.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: android.view.InflateException: Binary XML file line #25: Binary XML file line #25: You must supply a layout_width attribute.
Caused by: java.lang.UnsupportedOperationException: Binary XML file line #25: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:765)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:7034)
at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:7216)
at android.widget.LinearLayout$LayoutParams.(LinearLayout.java:1926)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1824)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1823)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:860)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
at android.databinding.k.do(DataBindingUtil.java:116)
at android.databinding.k.do(DataBindingUtil.java:88)
at com.hhly.community.ui.main.d.onCreateView(MainFragment.java:71)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2192)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:607)
at android.support.v7.app.f.onStart(AppCompatActivity.java:178)
at com.trello.rxlifecycle.components.a.a.onStart(RxAppCompatActivity.java:52)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
at android.app.Activity.performStart(Activity.java:6699)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2629)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
09-21 14:14:05.788 9768-9768/com.hhly.community E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

@JackCho
Copy link
Contributor

JackCho commented Sep 21, 2017

看日志是布局缺少个 layout_width ,你检查一下页面。
可能是哪里兼容性没考虑到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants