TinkerPatch / tinkerpatch-sdk

TinkerPatch SDK
http://tinkerpatch.com
MIT License
294 stars 56 forks source link

发现一个打包的问题 #62

Closed zhq93 closed 6 years ago

zhq93 commented 6 years ago

@simpleton @shwenzhang 1.我用菜单栏Build 下的Generate Signed Apk的生成基础包 然后再tinker打patch补丁包 发现合成后直接启动不起来了,报错crash导致App挂了..... 如下: 12-11 14:10:09.666 19129-19129/? D/Tinker.DefaultAppLike: onCreate 12-11 14:10:09.666 19129-19129/? I/Tinker.ServerUtils: with app key from manifest appKey:1b7c5d9b84b3a03b 12-11 14:10:09.666 19129-19129/? I/Tinker.ServerUtils: with app version from manifest appVersion:2.2.2 12-11 14:10:09.676 19129-19129/? I/Tinker.VersionInfo: readVersionInfo file path:/data/data/com.jdsq/tinker_server/1b7c5d9b84b3a03b_version.info, appVersion: 2.2.2, uuid:680f74bb-5e18-4dfe-9745-0764e5dfd6f7, abi:armeabi-v7a, patchVersion:1, patchMd5:b59b442c75d14080d557779c0843b312, grayValue:2, crashTimes:1, retryTimes:0, applySuccess:1, patchSuccess:1 12-11 14:10:09.676 19129-19129/? I/Tinker.Debugger: debugger attached 12-11 14:10:09.676 19129-19129/? D/Tinker.Debugger: getBoolean(): key=.com.tinker.debugtool.debug, value=true 12-11 14:10:09.676 19129-19129/? I/Tinker.ServerClient: installTinkerServer, debug value: true, appVersion: 2.2.2, appKey: 1b7c5d9b84b3a03b 12-11 14:10:09.676 19129-19129/? W/Tinker.Tinker: tinker patch directory: /data/data/com.jdsq/tinker 12-11 14:10:09.686 19129-19129/? I/dalvikvm: Could not find method android.app.AlarmManager.setExact, referenced from method com.tinkerpatch.sdk.tinker.service.TinkerServerResultService.a 12-11 14:10:09.686 19129-19129/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.1 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:0, process name:com.jdsq, main process:true, systemOTA:false, fingerPrint:OPPO/R7007/R7007:4.3/JLS36C/1390465867:user/release-keys, oatDir:odex, useInterpretMode:false 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: parseTinkerResult ldVersion:b59b442c75d14080d557779c0843b312, newVersion:b59b442c75d14080d557779c0843b312, current:b59b442c75d14080d557779c0843b312 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success 12-11 14:10:09.686 19129-19129/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/data/com.jdsq/tinker, code: 0, cost: 56ms 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerPatch: Init TinkerPatch sdk success, version:1.2.1 12-11 14:10:10.196 19129-19129/? I/Tinker.FetchPatchHandler: try to fetch patch update with FetchPatchHandler with interval 10800000 12-11 14:10:10.396 19129-19129/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad patch file: /data/data/com.jdsq/tinker_temp/temp.apk is not exist, just return 12-11 14:10:10.406 19129-19129/? W/Tinker.ClientImpl: [retryAllReportFails], there is no fail report, just return 12-11 14:10:10.416 19129-19129/? I/Tinker.UrlConnectionFetcher: loadData from url: http://q.tinkerpatch.com/dev/1b7c5d9b84b3a03b/2.2.2?d=680f74bb-5e18-4dfe-9745-

0764e5dfd6f7&v=1512972610425, method:GET, body:null 12-11 14:10:10.536 19129-19181/? I/Tinker.UrlConnectionFetcher: response code 200 msg: OK 12-11 14:10:10.536 19129-19181/? I/Tinker.ClientImpl: tinker server sync respond:{"v":1} 12-11 14:10:10.536 19129-19181/? I/Tinker.VersionInfo: VersionCheck: target version 1 is not latest. current version is 1 12-11 14:10:10.536 19129-19181/? I/Tinker.ClientImpl: Fetch result: needn't update, gray: 2 12-11 14:10:14.086 19129-19129/? E/Tinker.SampleUncaughtExHandler: uncaughtException: Class ref in pre-verified class resolved to unexpected implementation 12-11 14:10:14.086 19129-19129/? I/Tinker.VersionInfo: updateVersionInfo file path:/data/data/com.jdsq/tinker_server/1b7c5d9b84b3a03b_version.info, appVersion: 2.2.2, uuid:680f74bb-5e18-4dfe-9745-0764e5dfd6f7, abi:armeabi-v7a, patchVersion:1, patchMd5:b59b442c75d14080d557779c0843b312, grayValue:2, crashTimes:2, retryTimes:0,applySuccess:1, patchSuccess:1 12-11 14:10:14.106 19129-19129/? E/Tinker.SampleUncaughtExHandler: tinker has fast crash 2 times 12-11 14:10:14.106 19129-19129/? E/Tinker.UncaughtHandler: TinkerUncaughtHandler catch exception:java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation at com.jdsq.moudle.MainActivity.onCheckedChanged(MainActivity.java:261) at android.widget.RadioGroup.setCheckedId(RadioGroup.java:174) at android.widget.RadioGroup.access$600(RadioGroup.java:54) at android.widget.RadioGroup$CheckedStateTracker.onCheckedChanged(RadioGroup.java:358) at android.widget.CompoundButton.setChecked(CompoundButton.java:129) at android.widget.RadioGroup.setCheckedStateForView(RadioGroup.java:181) at android.widget.RadioGroup.check(RadioGroup.java:165) at com.jdsq.moudle.MainActivity.initListener(MainActivity.java:224) at com.jdsq.moudle.MainActivity.onCreate(MainActivity.java:77) at android.app.Activity.performCreate(Activity.java:5193) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2189) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286) at android.app.ActivityThread.access$600(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5178) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561) at dalvik.system.NativeStart.main(Native Method)

2.但是我如果用as右边栏的Gradle app Task build assembleRealse打包生成的基础包 再tinker生成patch补丁包就可以正常合成成功,且合成后的App可以修复后正常使用;

你好 这是什么原因,前面两种的签名文件一模一样,合成补丁成杜能正常使用,这是什么差异导致的呢?谢谢,希望能给我解惑 对Tinker还不是特别理解,希望能回复.

simpleton commented 6 years ago

请使用具体的task来打包,就是你描述的第二种方法(运行在命令行中也OK)。因为tinker的plugin会修改打包流程。

On Sun, Dec 10, 2017, 11:02 PM SimpleGentleman notifications@github.com wrote:

@simpleton https://github.com/simpleton @shwenzhang https://github.com/shwenzhang 1.我用菜单栏Build 下的Generate Signed Apk的生成基础包 然后再tinker打patch补丁包 发现合成后直接启动不起来了,报错crash导致App挂了..... 如下: 12-11 14:10:09.666 19129-19129/? D/Tinker.DefaultAppLike: onCreate 12-11 14:10:09.666 19129-19129/? I/Tinker.ServerUtils: with app key from manifest appKey:1b7c5d9b84b3a03b 12-11 14:10:09.666 19129-19129/? I/Tinker.ServerUtils: with app version from manifest appVersion:2.2.2 12-11 14:10:09.676 19129-19129/? I/Tinker.VersionInfo: readVersionInfo file path:/data/data/com.jdsq/tinker_server/1b7c5d9b84b3a03b_version.info, appVersion: 2.2.2, uuid:680f74bb-5e18-4dfe-9745-0764e5dfd6f7, abi:armeabi-v7a, patchVersion:1, patchMd5:b59b442c75d14080d557779c0843b312, grayValue:2, crashTimes:1, retryTimes:0, applySuccess:1, patchSuccess:1 12-11 14:10:09.676 19129-19129/? I/Tinker.Debugger: debugger attached 12-11 14:10:09.676 19129-19129/? D/Tinker.Debugger: getBoolean(): key=.com.tinker.debugtool.debug, value=true 12-11 14:10:09.676 19129-19129/? I/Tinker.ServerClient: installTinkerServer, debug value: true, appVersion: 2.2.2, appKey: 1b7c5d9b84b3a03b 12-11 14:10:09.676 19129-19129/? W/Tinker.Tinker: tinker patch directory: /data/data/com.jdsq/tinker 12-11 14:10:09.686 19129-19129/? I/dalvikvm: Could not find method android.app.AlarmManager.setExact, referenced from method com.tinkerpatch.sdk.tinker.service.TinkerServerResultService.a 12-11 14:10:09.686 19129-19129/? I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.9.1 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:0, process name:com.jdsq, main process:true, systemOTA:false, fingerPrint:OPPO/R7007/R7007:4.3/JLS36C/1390465867:user/release-keys, oatDir:odex, useInterpretMode:false 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: parseTinkerResult ldVersion:b59b442c75d14080d557779c0843b312, newVersion:b59b442c75d14080d557779c0843b312, current:b59b442c75d14080d557779c0843b312 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success 12-11 14:10:09.686 19129-19129/? I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/data/com.jdsq/tinker, code: 0, cost: 56ms 12-11 14:10:09.686 19129-19129/? I/Tinker.TinkerPatch: Init TinkerPatch sdk success, version:1.2.1 12-11 14:10:10.196 19129-19129/? I/Tinker.FetchPatchHandler: try to fetch patch update with FetchPatchHandler with interval 10800000 12-11 14:10:10.396 19129-19129/? W/Tinker.UpgradePatchRetry: onPatchRetryLoad patch file: /data/data/com.jdsq/tinker_temp/temp.apk is not exist, just return 12-11 14:10:10.406 19129-19129/? W/Tinker.ClientImpl: [retryAllReportFails], there is no fail report, just return 12-11 14:10:10.416 19129-19129/? I/Tinker.UrlConnectionFetcher: loadData from url: http://q.tinkerpatch.com/dev/1b7c5d9b84b3a03b/2.2.2?d=680f74bb-5e18-4dfe-9745-

0764e5dfd6f7&v=1512972610425, method:GET, body:null 12-11 14:10:10.536 19129-19181/? I/Tinker.UrlConnectionFetcher: response code 200 msg: OK 12-11 14:10:10.536 19129-19181/? I/Tinker.ClientImpl: tinker server sync respond:{"v":1} 12-11 14:10:10.536 19129-19181/? I/Tinker.VersionInfo: VersionCheck: target version 1 is not latest. current version is 1 12-11 14:10:10.536 19129-19181/? I/Tinker.ClientImpl: Fetch result: needn't update, gray: 2 12-11 14:10:14.086 19129-19129/? E/Tinker.SampleUncaughtExHandler: uncaughtException: Class ref in pre-verified class resolved to unexpected implementation 12-11 14:10:14.086 19129-19129/? I/Tinker.VersionInfo: updateVersionInfo file path:/data/data/com.jdsq/tinker_server/1b7c5d9b84b3a03b_version.info, appVersion: 2.2.2, uuid:680f74bb-5e18-4dfe-9745-0764e5dfd6f7, abi:armeabi-v7a, patchVersion:1, patchMd5:b59b442c75d14080d557779c0843b312, grayValue:2, crashTimes:2, retryTimes:0,applySuccess:1, patchSuccess:1 12-11 14:10:14.106 19129-19129/? E/Tinker.SampleUncaughtExHandler: tinker has fast crash 2 times 12-11 14:10:14.106 19129-19129/? E/Tinker.UncaughtHandler: TinkerUncaughtHandler catch exception:java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation at com.jdsq.moudle.MainActivity.onCheckedChanged(MainActivity.java:261) at android.widget.RadioGroup.setCheckedId(RadioGroup.java:174) at android.widget.RadioGroup.access$600(RadioGroup.java:54) at android.widget.RadioGroup$CheckedStateTracker.onCheckedChanged(RadioGroup.java:358) at android.widget.CompoundButton.setChecked(CompoundButton.java:129) at android.widget.RadioGroup.setCheckedStateForView(RadioGroup.java:181) at android.widget.RadioGroup.check(RadioGroup.java:165) at com.jdsq.moudle.MainActivity.initListener(MainActivity.java:224) at com.jdsq.moudle.MainActivity.onCreate(MainActivity.java:77) at android.app.Activity.performCreate(Activity.java:5193) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2189) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286) at android.app.ActivityThread.access$600(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1259) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5178) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561) at dalvik.system.NativeStart.main(Native Method)

2.但是我如果用as右边栏的Gradle app Task build assembleRealse打包生成的基础包 再tinker生成patch补丁包就可以正常合成成功,且合成后的App可以修复后正常使用;

你好 这是什么原因,前面两种的签名文件一模一样,合成补丁成杜能正常使用,这是什么差异导致的呢?谢谢,希望能给我解惑 对Tinker还不是特别理解,希望能回复.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TinkerPatch/tinkerpatch-sdk/issues/62, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbvYpepkBfsj78AVgMIITtywQFiiFH7ks5s_NNlgaJpZM4Q88ao .

zhq93 commented 6 years ago

谢谢了