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

大佬好,我这边打出补丁后native代码改动生效,但是flutter代码无效,从哪里入手分析可以知道问题出在哪 #5

Open
HotSummerJuly opened this issue Aug 10, 2020 · 20 comments

Comments

@HotSummerJuly
Copy link

我是直接使用的tinker,tinker 依赖库的版本是1.9.14.6,插件的版本是1.9.9,插桩库是您最新的版本。
我检查了打包出来的补丁,里面存在lib\armeabi-v7a\libapp.so

@magicbaby810
Copy link
Owner

我是直接使用的tinker,tinker 依赖库的版本是1.9.14.6,插件的版本是1.9.9,插桩库是您最新的版本。
我检查了打包出来的补丁,里面存在lib\armeabi-v7a\libapp.so

看下log控制台是否有 is use tinker 和 flutter patch is loaded successfully 这两个log?

@magicbaby810
Copy link
Owner

magicbaby810 commented Aug 10, 2020

9881-9881/? I/Tinker: find FlutterMain
9881-9881/? I/Tinker: cpu abi is:arm64-v8a
9881-9881/? I/Tinker: flutterPatchInit() called   true true
9881-9881/? I/Tinker: findLibraryFromTinker success:/data/user/0/com.sk.hotfixflutter/tinker/patch-e279f9dc/lib/lib/arm64-v8a/libapp.so
9881-9881/? I/Tinker: flutter patch is loaded successfully

我试了下可以的,这是加载成功的日志,你对照下

@HotSummerJuly
Copy link
Author

2020-08-11 09:06:52.307 24468-24468/? I/Tinker: find FlutterMain
2020-08-11 09:06:52.307 24468-24468/? I/Tinker: cpu abi is:arm64-v8a
2020-08-11 09:06:52.307 24468-24468/? I/Tinker: flutterPatchInit() called true true
2020-08-11 09:06:52.307 24468-24468/? I/Tinker: flutter patch is loaded successfully

少了一行日志... 我去检查下

@magicbaby810
Copy link
Owner

hannibal是1.0.7吗? 1.0.7忘记上传了,你检查下再试试

@HotSummerJuly
Copy link
Author

hannibal是1.0.7吗? 1.0.7忘记上传了,你检查下再试试

1.0.5.1 ,这个有影响吗?那我换成1.0.7试试

@magicbaby810
Copy link
Owner

hannibal是1.0.7吗? 1.0.7忘记上传了,你检查下再试试

1.0.5.1 ,这个有影响吗?那我换成1.0.7试试

用最新的

@HotSummerJuly
Copy link
Author

2020-08-11 14:30:06.050 12856-12856/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, ok!
2020-08-11 14:30:06.081 12856-12856/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: find FlutterMain
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: lib path is null

日志打印出来是这样

@magicbaby810
Copy link
Owner

magicbaby810 commented Aug 11, 2020

2020-08-11 14:30:06.050 12856-12856/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, ok!
2020-08-11 14:30:06.081 12856-12856/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: find FlutterMain
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: lib path is null

日志打印出来是这样

这样的log你看下FlutterPatch类,是因为没找到Tinker初始化的地方,isUseTinker是false,如果找到的话,会打印 is use tinker

/**
     * Sophix 插桩方法,获取项目是否使用Tinker
     *
     * 此方法不可修改,否则不会成功
     */
    public static void hookIsUseTinker() {
        isUseTinker = true;
        TinkerLog.i(TAG, "is use tinker");
    }

你先要确认hannibal是1.0.7再确认是否初始化了Tinker

@HotSummerJuly
Copy link
Author

2020-08-11 14:30:06.050 12856-12856/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, ok!
2020-08-11 14:30:06.081 12856-12856/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: find FlutterMain
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: lib path is null

日志打印出来是这样

这样的log你看下FlutterPatch类,是因为没找到Tinker初始化的地方,isUseTinker是false,如果找到的话,会打印 is use tinker

/**
     * Sophix 插桩方法,获取项目是否使用Tinker
     *
     * 此方法不可修改,否则不会成功
     */
    public static void hookIsUseTinker() {
        isUseTinker = true;
        TinkerLog.i(TAG, "is use tinker");
    }

你先要确认hannibal是1.0.7再确认是否初始化了Tinker

是的 版本是最新的并且tinker也初始化了,如果没有初始化的话 native的补丁应该应用不上去的吧,测试native的代码改动生效
classpath 'com.sk.hannibal:hannibal:1.0.7'
implementation 'com.sk.flutterpatch:flutterpatch:0.0.5.1'

@magicbaby810
Copy link
Owner

2020-08-11 14:30:06.050 12856-12856/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, ok!
2020-08-11 14:30:06.081 12856-12856/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: find FlutterMain
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: lib path is null

日志打印出来是这样

这样的log你看下FlutterPatch类,是因为没找到Tinker初始化的地方,isUseTinker是false,如果找到的话,会打印 is use tinker

/**
     * Sophix 插桩方法,获取项目是否使用Tinker
     *
     * 此方法不可修改,否则不会成功
     */
    public static void hookIsUseTinker() {
        isUseTinker = true;
        TinkerLog.i(TAG, "is use tinker");
    }

你先要确认hannibal是1.0.7再确认是否初始化了Tinker

是的 版本是最新的并且tinker也初始化了,如果没有初始化的话 native的补丁应该应用不上去的吧,测试native的代码改动生效

classpath 'com.sk.hannibal:hannibal:1.0.7'

implementation 'com.sk.flutterpatch:flutterpatch:0.0.5.1'

哥们,给个联系方式,沟通下

@HotSummerJuly
Copy link
Author

2020-08-11 14:30:06.050 12856-12856/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, ok!
2020-08-11 14:30:06.081 12856-12856/? I/Tinker.TinkerLoadResult: oh yeah, tinker load all success
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: find FlutterMain
2020-08-11 14:30:06.407 12856-12856/? I/Tinker: lib path is null

日志打印出来是这样

这样的log你看下FlutterPatch类,是因为没找到Tinker初始化的地方,isUseTinker是false,如果找到的话,会打印 is use tinker

/**
     * Sophix 插桩方法,获取项目是否使用Tinker
     *
     * 此方法不可修改,否则不会成功
     */
    public static void hookIsUseTinker() {
        isUseTinker = true;
        TinkerLog.i(TAG, "is use tinker");
    }

你先要确认hannibal是1.0.7再确认是否初始化了Tinker

是的 版本是最新的并且tinker也初始化了,如果没有初始化的话 native的补丁应该应用不上去的吧,测试native的代码改动生效
classpath 'com.sk.hannibal:hannibal:1.0.7'
implementation 'com.sk.flutterpatch:flutterpatch:0.0.5.1'

哥们,给个联系方式,沟通下

我的微信号是hotsummerjuly

@Elex92
Copy link

Elex92 commented Dec 8, 2020

遇到同样的问题,请指教。更新补丁只有原生代码的改动生效了,flutter改动的代码没有生效

@Elex92
Copy link

Elex92 commented Dec 8, 2020

2020-12-08 16:09:28.472 27676-27676/? I/Tinker.IncrementCompMgr: package has no incremental component meta, skip init.
2020-12-08 16:09:28.472 27676-27676/? I/Tinker.TinkerLoader: tryLoadPatchFiles: load end, `ok!`
2020-12-08 16:09:28.472 27676-27676/? D/Tinker.DefaultAppLike: onBaseContextAttached:
2020-12-08 16:09:28.474 27676-27676/? W/Tinker.TinkerInternals: setSafeModeCount: preferName:tinker_own_config_com.sk.hotfixflutter count:0
2020-12-08 16:09:28.474 27676-27676/? I/Tinker.ReflectApp: with app realApplication from manifest applicationName:com.sk.hotfixflutter.AppApplication
2020-12-08 16:09:28.476 27676-27676/? I/Tinker: is use tinker
2020-12-08 16:09:28.477 27676-27676/? I/Tinker.TinkerPatchListener: application maxMemory:384 #

这是日志

@heroghost
Copy link

我掐指一算,可能是你的flutter版本比期望版本高

@st1994
Copy link

st1994 commented Mar 17, 2021

9881-9881/? I/Tinker: find FlutterMain
9881-9881/? I/Tinker: cpu abi is:arm64-v8a
9881-9881/? I/Tinker: flutterPatchInit() called   true true
9881-9881/? I/Tinker: findLibraryFromTinker success:/data/user/0/com.sk.hotfixflutter/tinker/patch-e279f9dc/lib/lib/arm64-v8a/libapp.so
9881-9881/? I/Tinker: flutter patch is loaded successfully

我试了下可以的,这是加载成功的日志,你对照下

我的也有原生代码生效,flutter失效的情况,但是这些日志都有,2021-03-17 14:59:49.329 17068-17068/? I/Tinker: flutter patch is loaded successfully,是不是flutter和boost的版本有要求?目前是'v1.22.4-hotfixes'

@magicbaby810
Copy link
Owner

9881-9881/? I/Tinker: find FlutterMain
9881-9881/? I/Tinker: cpu abi is:arm64-v8a
9881-9881/? I/Tinker: flutterPatchInit() called   true true
9881-9881/? I/Tinker: findLibraryFromTinker success:/data/user/0/com.sk.hotfixflutter/tinker/patch-e279f9dc/lib/lib/arm64-v8a/libapp.so
9881-9881/? I/Tinker: flutter patch is loaded successfully

我试了下可以的,这是加载成功的日志,你对照下

我的也有原生代码生效,flutter失效的情况,但是这些日志都有,2021-03-17 14:59:49.329 17068-17068/? I/Tinker: flutter patch is loaded successfully,是不是flutter和boost的版本有要求?目前是'v1.22.4-hotfixes'

新版本的boost有问题,不支持

@tommyhh
Copy link

tommyhh commented Mar 23, 2021

我也是用用flutter + boost v1.22.4-hotfixes 这个,原生代码生效,flutter失效,请问新版本的boost的问题有方法可以解决么?

@magicbaby810
Copy link
Owner

我也是用用flutter + boost v1.22.4-hotfixes 这个,原生代码生效,flutter失效,请问新版本的boost的问题有方法可以解决么

boost不兼容好,我怎么给你解决啊,等boost出新版本把

@chengxushi
Copy link

9881-9881/? I/Tinker: find FlutterMain
9881-9881/? I/Tinker: cpu abi is:arm64-v8a
9881-9881/? I/Tinker: flutterPatchInit() called   true true
9881-9881/? I/Tinker: findLibraryFromTinker success:/data/user/0/com.sk.hotfixflutter/tinker/patch-e279f9dc/lib/lib/arm64-v8a/libapp.so
9881-9881/? I/Tinker: flutter patch is loaded successfully

我试了下可以的,这是加载成功的日志,你对照下

你好, 请问一下, 我按照readme配置了之后, 在补丁包里有看到更新的libapp.so文件和在assets文件夹中看到新加的图片, 热更新安卓代码生效, 但Flutter的代码无效, 而且我没有上面的日志, 请问是怎么回事?
我的配置是:
classpath 'com.github.magicbaby810:hannibal:1.0.9'

tinker版本: implementation 'com.tencent.tinker:tinker-android-lib:1.9.9'

@magicbaby810
Copy link
Owner

9881-9881/? I/Tinker: find FlutterMain
9881-9881/? I/Tinker: cpu abi is:arm64-v8a
9881-9881/? I/Tinker: flutterPatchInit() called   true true
9881-9881/? I/Tinker: findLibraryFromTinker success:/data/user/0/com.sk.hotfixflutter/tinker/patch-e279f9dc/lib/lib/arm64-v8a/libapp.so
9881-9881/? I/Tinker: flutter patch is loaded successfully

我试了下可以的,这是加载成功的日志,你对照下

你好, 请问一下, 我按照readme配置了之后, 在补丁包里有看到更新的libapp.so文件和在assets文件夹中看到新加的图片, 热更新安卓代码生效, 但Flutter的代码无效, 而且我没有上面的日志, 请问是怎么回事?
我的配置是:
classpath 'com.github.magicbaby810:hannibal:1.0.9'

tinker版本: implementation 'com.tencent.tinker:tinker-android-lib:1.9.9'

来麻花疼 1151212481

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

7 participants