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

IndexOutOfBoundsException: End index: 5 >= 4 #381

Closed
CzwAthou opened this issue Sep 16, 2022 · 0 comments
Closed

IndexOutOfBoundsException: End index: 5 >= 4 #381

CzwAthou opened this issue Sep 16, 2022 · 0 comments

Comments

@CzwAthou
Copy link

CzwAthou commented Sep 16, 2022

Please provide the following informations.

  • Java version. 9.0.4

  • Gradle version 6.9

  • Android Gradle plugin version. 4.0.1

  • Booster version. 4.13.0

  • Stack traces
    Caused by: java.lang.IndexOutOfBoundsException: End index: 5 >= 4
    at com.google.protobuf.ByteString.checkRange(ByteString.java:1263)
    at com.google.protobuf.ByteString.copyTo(ByteString.java:649)
    at com.google.protobuf.ByteString.copyTo(ByteString.java:632)
    at com.didiglobal.booster.aapt2.Aapt2ParserKt.parseResFileMetadata(Aapt2Parser.kt:92)
    at com.didiglobal.booster.aapt2.Aapt2ParserKt.getMetadata(Aapt2Parser.kt:33)
    at com.didiglobal.booster.task.compression.cwebp.CwebpCompressFlatImages$compress$1.apply(CwebpCompressFlatImages.kt:60)
    at com.didiglobal.booster.task.compression.cwebp.CwebpCompressFlatImages$compress$1.apply(CwebpCompressFlatImages.kt:30)

debug了下。发现项目里会存在 drawable-pt-rBr-xxhdpi 这样的图片文件夹, 在CwebpCompressFlatImages解析的时候, config.local为pt-Br, 为5位, 而localeScript为4位, 所以调用copyto方法会报错, (参见Aapt2Parse.kt parseResFileMetadata 方法)

@CzwAthou CzwAthou reopened this Sep 16, 2022
johnsonlee added a commit to johnsonlee/booster that referenced this issue Oct 22, 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

2 participants