TinkerPatch / tinkerpatch-sdk

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

增加上传补丁包的task #26

Open simpleton opened 7 years ago

simpleton commented 7 years ago

需要后台api支持。

RongStone commented 7 years ago

引入tinkerpatch-sdk后编译运行闪退: 1.在tinkerpatch.gradle的tinkerpatchSupport中设置tinkerEnable = true;

image

2.项目build.gradle配置 provided("com.tencent.tinker:tinker-android-anno:1.7.9") compile("com.tinkerpatch.sdk:tinkerpatch-android-sdk:1.1.6")

3.异常log打印 05-18 14:39:32.783 19341-19341/tinker.sample.android D/dalvikvm: threadid=1: still suspended after undo (sc=1 dc=1) 05-18 14:40:12.903 19341-19341/tinker.sample.android W/Tinker.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/data/tinker.sample.android/tinker 05-18 14:41:20.363 19341-19341/tinker.sample.android D/Tinker.DefaultAppLike: onBaseContextAttached: 05-18 14:41:23.433 19341-19341/tinker.sample.android I/MultiDex: VM with version 1.6.0 does not have multidex support 05-18 14:41:23.433 19341-19341/tinker.sample.android I/MultiDex: install 05-18 14:41:23.453 19341-19341/tinker.sample.android I/MultiDex: MultiDexExtractor.load(/data/app/tinker.sample.android-1.apk, false) 05-18 14:41:23.503 19341-19341/tinker.sample.android I/MultiDex: loading existing secondary dex files 05-18 14:41:23.503 19341-19341/tinker.sample.android I/MultiDex: load found 0 secondary dex files 05-18 14:41:23.503 19341-19341/tinker.sample.android I/MultiDex: install done 05-18 14:41:48.883 19341-19341/tinker.sample.android I/Tinker.SamplePatchListener: application maxMemory:96 05-18 14:41:48.913 19341-19341/tinker.sample.android W/Tinker.Tinker: tinker patch directory: /data/data/tinker.sample.android/tinker 05-18 14:41:48.923 19341-19341/tinker.sample.android I/Tinker.Tinker: try to install tinker, isEnable: true, version: 1.7.9.2 05-18 14:41:48.933 19341-19341/tinker.sample.android I/Tinker.TinkerLoadResult: parseTinkerResult loadCode:-2, process name:tinker.sample.android, main process:true, systemOTA:false, oatDir:null, useInterpretMode:false 05-18 14:41:48.933 19341-19341/tinker.sample.android W/Tinker.TinkerLoadResult: can't find patch file, is ok, just return 05-18 14:41:48.943 19341-19341/tinker.sample.android I/Tinker.DefaultLoadReporter: patch loadReporter onLoadResult: patch load result, path:/data/data/tinker.sample.android/tinker, code: -2, cost: 50068ms 05-18 14:41:48.953 19341-19341/tinker.sample.android W/Tinker.Tinker: tinker load fail! 05-18 14:42:29.943 19341-19341/tinker.sample.android D/Tinker.DefaultAppLike: onCreate 05-18 14:46:45.013 19341-19341/tinker.sample.android I/Tinker.ServerUtils: with app key from manifest appKey:d83d7c56d1868274 05-18 14:46:47.413 19341-19341/tinker.sample.android I/Tinker.ServerUtils: with app version from manifest appVersion:1.0.0 05-18 14:46:48.283 19341-19341/tinker.sample.android I/Tinker.VersionInfo: readVersionInfo file path:/data/data/tinker.sample.android/tinker_server/d83d7c56d1868274_version.info, appVersion: 1.0.0, uuid:2a40e795-0cff-47d2-8141-c631f7f238f7, abi:armeabi-v7a, patchVersion:0, patchMd5:, grayValue:7, crashTimes:0, retryTimes:0, applySuccess:0 05-18 14:46:59.183 19341-19341/tinker.sample.android I/dalvikvm: Could not find method android.content.Context.checkSelfPermission, referenced from method com.tinkerpatch.sdk.server.a.a 05-18 14:46:59.193 19341-19341/tinker.sample.android W/dalvikvm: VFY: unable to resolve virtual method 265: Landroid/content/Context;.checkSelfPermission (Ljava/lang/String;)I 05-18 14:46:59.193 19341-19341/tinker.sample.android D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b 05-18 14:46:59.233 19341-19341/tinker.sample.android D/Tinker.Debugger: debugger not attached cu == null 05-18 14:46:59.233 19341-19341/tinker.sample.android E/ActivityThread: Failed to find provider info for com.tinker.debug.debugprovider 05-18 14:46:59.233 19341-19341/tinker.sample.android I/Tinker.ServerClient: installTinkerServer, debug value: false, appVersion: 1.0.0, appKey: d83d7c56d1868274 05-18 14:46:59.843 19341-19341/tinker.sample.android W/Tinker.Tinker: tinker patch directory: /data/data/tinker.sample.android/tinker 05-18 14:50:47.953 19341-19341/tinker.sample.android D/AndroidRuntime: Shutting down VM 05-18 14:50:47.953 19341-19341/tinker.sample.android W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x430c0910) 05-18 14:50:47.953 19341-19341/tinker.sample.android E/Tinker.SampleUncaughtExHandler: uncaughtException: Unable to create application tinker.sample.android.app.SampleApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. 05-18 14:50:47.983 19341-19341/tinker.sample.android W/Tinker.SampleUncaughtExHandler: tinker is not loaded, just return 05-18 14:50:47.993 19341-19341/tinker.sample.android E/Tinker.SampleUncaughtExHandler: uncaughtException:Unable to create application tinker.sample.android.app.SampleApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. 05-18 14:50:48.003 19341-19341/tinker.sample.android W/Tinker.SampleUncaughtExHandler: tinker is not loaded 05-18 14:50:48.273 19341-19341/tinker.sample.android E/Tinker.UncaughtHandler: catch exception when loading tinker:java.lang.RuntimeException: Unable to create application tinker.sample.android.app.SampleApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4731) at android.app.ActivityThread.access$1600(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5457) 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:879) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695) at dalvik.system.NativeStart.main(Native Method) Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. at com.tencent.tinker.lib.tinker.Tinker.create(Tinker.java:123) at com.tencent.tinker.lib.tinker.TinkerInstaller.install(TinkerInstaller.java:70) at com.tinkerpatch.sdk.TinkerPatch.(SourceFile:102) at com.tinkerpatch.sdk.TinkerPatch$Builder.build(SourceFile:577) at com.tinkerpatch.sdk.TinkerPatch.init(SourceFile:126) at tinker.sample.android.app.SampleApplicationLike.onCreate(SampleApplicationLike.java:111) at com.tencent.tinker.loader.app.TinkerApplication.onCreate(TinkerApplication.java:173) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728) at android.app.ActivityThread.access$1600(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:137)  at android.app.ActivityThread.main(ActivityThread.java:5457)  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:879)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695)  at dalvik.system.NativeStart.main(Native Method)  05-18 14:50:48.393 19341-19341/tinker.sample.android E/AndroidRuntime: FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create application tinker.sample.android.app.SampleApplication: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4731) at android.app.ActivityThread.access$1600(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5457) 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:879) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695) at dalvik.system.NativeStart.main(Native Method) Caused by: com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set. at com.tencent.tinker.lib.tinker.Tinker.create(Tinker.java:123) at com.tencent.tinker.lib.tinker.TinkerInstaller.install(TinkerInstaller.java:70) at com.tinkerpatch.sdk.TinkerPatch.(SourceFile:102) at com.tinkerpatch.sdk.TinkerPatch$Builder.build(SourceFile:577) at com.tinkerpatch.sdk.TinkerPatch.init(SourceFile:126) at tinker.sample.android.app.SampleApplicationLike.onCreate(SampleApplicationLike.java:111) at com.tencent.tinker.loader.app.TinkerApplication.onCreate(TinkerApplication.java:173) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4728) at android.app.ActivityThread.access$1600(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1379)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:137)  at android.app.ActivityThread.main(ActivityThread.java:5457)  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:879)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:695)  at dalvik.system.NativeStart.main(Native Method)  05-18 14:55:48.843 19341-19341/tinker.sample.android I/Process: Sending signal. PID: 19341 SIG: 9

能否帮忙看下是哪的问题么?感谢!

simpleton commented 7 years ago

@RongStone 多谢你的issue,但是你应该新建一个,而不是在别的issue下提。 你是使用不改造application的方法接入的么?那需要设置reflectApplication = true.

RongStone commented 7 years ago

使用不改造application的方法接入,设置reflectApplication = true后仍然报了相同的错误

simpleton commented 7 years ago

@RongStone 这个看起来是多次set了tinker,你可以把初始化的代码片段贴在这里么?或者通过如下联系方式直接实时联系我们。

qq: 258699730 slack: https://slack.tinkerpatch.com

05-18 14:50:47.953 19341-19341/tinker.sample.android E/Tinker.SampleUncaughtExHandler: 

uncaughtException: Unable to create application tinker.sample.android.app.SampleApplication:

com.tencent.tinker.loader.TinkerRuntimeException: Tinker Exception:Tinker instance is already set.