关于上传 GP aab 包,报错 “Invalid uncompressed glob“ 的解决

之前打包盒上传 aab 包一直没问题,今天突然报错如下:

复制代码
针对您上传的 App Bundle 运行 bundletool build-apks 时出错。
请在本地运行 bundletool build-apks,确保您的 App Bundle 有效,然后重试。
错误:Invalid uncompressed glob: '**['.[uU][nN][iI][tT][yY]3[dD]', '.[rR][eE][sS][sS]', '.[rR][eE][sS][oO][uU][rR][cC][eE]', '.[oO][bB][bB]', '.[bB][uU][nN][dD][lL][eE]', '.[uU][nN][iI][tT][yY][eE][xX][pP]'] + [uU][nN][iI][tT][yY][sS][tT][rR][eE][aA][mM][iI][nN][gG][aA][sS][sS][eE][tT][sS].[tT][oO][kK][eE][nN][iI][zZ][eE](', ')'.

通过本地的 bundletool 工具测试报错如下:

c 复制代码
[BT:1.17.1] Error: Invalid uncompressed glob: '**['.[uU][nN][iI][tT][yY]3[dD]', '.[rR][eE][sS][sS]', '.[rR][eE][sS][oO][uU][rR][cC][eE]', '.[oO][bB][bB]', '.[bB][uU][nN][dD][lL][eE]', '.[uU][nN][iI][tT][yY][eE][xX][pP]'] + [uU][nN][iI][tT][yY][sS][tT][rR][eE][aA][mM][iI][nN][gG][aA][sS][sS][eE][tT][sS].[tT][oO][kK][eE][nN][iI][zZ][eE](', ')'.
com.android.tools.build.bundletool.model.exceptions.InvalidBundleException: Invalid uncompressed glob: '**['.[uU][nN][iI][tT][yY]3[dD]', '.[rR][eE][sS][sS]', '.[rR][eE][sS][oO][uU][rR][cC][eE]', '.[oO][bB][bB]', '.[bB][uU][nN][dD][lL][eE]', '.[uU][nN][iI][tT][yY][eE][xX][pP]'] + [uU][nN][iI][tT][yY][sS][tT][rR][eE][aA][mM][iI][nN][gG][aA][sS][sS][eE][tT][sS].[tT][oO][kK][eE][nN][iI][zZ][eE](', ')'.
        at com.android.tools.build.bundletool.model.exceptions.UserExceptionBuilder.build(UserExceptionBuilder.java:58)
        at com.android.tools.build.bundletool.validation.BundleConfigValidator.validateCompression(BundleConfigValidator.java:78)
        at com.android.tools.build.bundletool.validation.BundleConfigValidator.validateBundle(BundleConfigValidator.java:59)
        at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundleUsingSubValidator(ValidatorRunner.java:79)
        at com.android.tools.build.bundletool.validation.ValidatorRunner.lambda$validateBundle$4(ValidatorRunner.java:64)
        at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
        at com.android.tools.build.bundletool.validation.ValidatorRunner.validateBundle(ValidatorRunner.java:64)
        at com.android.tools.build.bundletool.validation.AppBundleValidator.validate(AppBundleValidator.java:114)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:920)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:83)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:55)
Caused by: com.android.tools.build.bundletool.model.utils.PathMatcher$GlobPatternSyntaxException: Unable to parse glob pattern '**['.[uU][nN][iI][tT][yY]3[dD]', '.[rR][eE][sS][sS]', '.[rR][eE][sS][oO][uU][rR][cC][eE]', '.[oO][bB][bB]', '.[bB][uU][nN][dD][lL][eE]', '.[uU][nN][iI][tT][yY][eE][xX][pP]'] + [uU][nN][iI][tT][yY][sS][tT][rR][eE][aA][mM][iI][nN][gG][aA][sS][sS][eE][tT][sS].[tT][oO][kK][eE][nN][iI][zZ][eE](', ')' at character 173. Error: No matching '[' found.
        at com.android.tools.build.bundletool.model.utils.PathMatcher.convertGlobToRegexp(PathMatcher.java:142)
        at com.android.tools.build.bundletool.model.utils.PathMatcher.createFromGlob(PathMatcher.java:52)
        at com.android.tools.build.bundletool.validation.BundleConfigValidator.validateCompression(BundleConfigValidator.java:73)
        ... 9 more

但是可以正常打 apk 包,运行也正常,查了半天没有什么有用的信息,下面是最后解决问题的方案:

查看 build.gradle 文件中的 noCompress 配置

noCompress '['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')'

我遇到的问题是该配置过时了,需要改成如下的写法

noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp'] + unityStreamingAssets.tokenize(', ')

更改完成后就没问题了。

相关推荐
lichong95127 分钟前
XLog debug 开启打印日志,release 关闭打印日志
android·java·前端
用户69371750013841 小时前
14.Kotlin 类:类的形态(一):抽象类 (Abstract Class)
android·后端·kotlin
火柴就是我1 小时前
NekoBoxForAndroid 编译libcore.aar
android
Kaede62 小时前
MySQL中如何使用命令行修改root密码
android·mysql·adb
明君879973 小时前
Flutter 图纸标注功能的实现:踩坑与架构设计
android·ios
成都大菠萝3 小时前
Android Auto开发(3)-Audio Integration
android
成都大菠萝4 小时前
Android Auto开发(5)-Audio Integration
android
泡沫·4 小时前
7.LAMPLNMP 最佳实践
android
码码宁4 小时前
六个故事搞懂Fragment 故事1-初识Fragment - NewsHub的模块化革命
android
成都大菠萝5 小时前
Android Auto开发(0)-引言
android