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

Mac M1 打patch包 无法编译 #358

Open
helixs opened this issue Apr 27, 2022 · 1 comment
Open

Mac M1 打patch包 无法编译 #358

helixs opened this issue Apr 27, 2022 · 1 comment

Comments

@helixs
Copy link

helixs commented Apr 27, 2022

设备:MacBookPro M1芯片
执行:buildTinkerPatchRelease
错误:

304 actionable tasks: 20 executed, 284 up-to-date
Execution failed for task ':app:tinkerPatchRelease'.
> Could not resolve all files for configuration ':app:sevenZipToolsLocator'.
   > Could not find SevenZip-1.1.10-osx-aarch_64.exe (com.tencent.mm:SevenZip:1.1.10).
     Searched in the following locations:
         https://jcenter.bintray.com/com/tencent/mm/SevenZip/1.1.10/SevenZip-1.1.10-osx-aarch_64.exe

问题1:我在tinker-support.gradle 下面的tinkerPatch 配置了

sevenZip {
        zipArtifact = "com.tencent.mm:SevenZip:1.2.17" 
     // path = "/usr/local/bin/7za"
}

为什么还会到仓库拉取1.1.10的版本,就算把整个zipArtifact注释掉,还是没用,配置不会有效果。请问该如何配置版本。

问题2:maven仓库下面没有提供osx-aarch_64的版本,有什么办法可以解决吗?

@helixs
Copy link
Author

helixs commented Apr 27, 2022

我找到了解决办法其中一种解决办法,动态判断是否是aarch64,因为打包机器是x86的,而我开发的电脑是m1,通过homebrew安装了7zip,直接命令是7zz,有点是7za,看情况吧。

sevenZip {
        zipArtifact = "com.tencent.mm:SevenZip:1.2.17"
        path=isAarch64()?"/opt/homebrew/bin/7zz":null
    }
def isAarch64(){
    String arch = System.getProperty("os.arch")
    println("系统aarch:"+arch)
    return  arch.equalsIgnoreCase("aarch64")
}

另外很多情况下会遇到meta-data<tinker_id> 不能插入到AndroidManifest文件中,出错几率很高,百思不得其解,
can't find TINKER_ID from the (new/old)apk manifest file, it must be set!

为啥什么文档都不更新

借鉴自这里

@helixs helixs closed this as completed Apr 27, 2022
@helixs helixs reopened this Apr 28, 2022
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

1 participant