上线 应用,记得上次打包是一个月前,使用 Android App Bundle 方式,没有报错,今天出现错误了
Errors while building Signed Android App Bundle file. Execution failed for task ':app:signReleaseBundle' > 'other' has different root
很是郁闷,尝试 clean ,打包还是出错,rebuild,重启As还是不行,
网上百度了,说是让关闭 install run ,关闭了还是不行,
万能的google ,人家说的如下:
Well, I've got the solution to this problem. Android Studio 4.0 has this weird bug that you've to select the KeyStore path and release destination folder in the root directory (C:/ or D:/ or E:/, whatever) same as where your project resides in order to generate the Signed App Bundle.
Like suppose you've got your project in the C:/ directory. Then, during selecting path for keystore and release destination folder for your signed app bundle, you've to be sure that the root directory for these paths should be C:/.
Why they have done this, there's no idea about that. But, this error is there in Android Studio 4.0, although only in case of Signed App Bundles. With Signed APKs, it is working pretty normal.
意思就是说,你的项目(project),你的签名文件(.jks文件),还有你的打包生成abb文件(要上架的abb包)要放在相同的根目录下,无论是 c盘d盘e 盘都行,但是必须一致,然后clean下,打包就能成功了!!!
实在不懂看图1,和图2