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

Unable to find method 'kotlin.io.ByteStreamsKt.readBytes(Ljava/io/InputStream;)[B'. #80

Closed
johnsonlee opened this issue Jul 12, 2019 · 24 comments

Comments

@johnsonlee
Copy link
Collaborator

使用0.21.0时,编译不通过,如下:
Unable to find method 'kotlin.io.ByteStreamsKt.readBytes(Ljava/io/InputStream;)[B'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Re-download dependencies and sync project没有效果。
使用0.19.0这个版本没有这个问题;
使用0.21.0时,引入时不能单独放在项目的build.gradle下面,只能放在app的build.gradle下面

Originally posted by @HQLIE2018 in #78 (comment)

johnsonlee added a commit that referenced this issue Jul 12, 2019
@HQLIE2018
Copy link

buildscript {
ext {
kotlin_version = '1.3.31'
booster_version = '0.21.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/public/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
classpath "com.didiglobal.booster:booster-transform-shrink:$booster_version"
classpath "com.didiglobal.booster:booster-task-compression:$booster_version"
}
}

allprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/public/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.didiglobal.booster'
这个是APP下的build.gradle配置

@johnsonlee
Copy link
Collaborator Author

johnsonlee commented Jul 12, 2019

这个问题已经 fix 了,0.21.2 已经上传,同步到 mavenCentral 可能还需要一会儿

@HQLIE2018
Copy link

可以了,谢谢!也可以在项目的build.gradle下面配置了,是不是每次打包都要确认一次才可以?> Task :app:installCwebp 是否确定(Y/N)?

@johnsonlee
Copy link
Collaborator Author

可以了,谢谢!也可以在项目的build.gradle下面配置了,是不是每次打包都要确认一次才可以?> Task :app:installCwebp 是否确定(Y/N)?

Duplicate of #29

这个问题之前处理过,可能跟 cacls 的版本有关系,在 win 10 专业版测过没问题,在其它版本没有测过,麻烦在命令提示符下运行下面这个命令,把命令提示符输出的内容粘一下:

echo y | cacls app/build/bin/cwebp.exe /t /p everyone:f

谢谢!

@HQLIE2018
Copy link

echo y | cacls app/build/bin/cwebp.exe /t /p everyone:f
是否确定(Y/N)?
运行之后是这样子的

@johnsonlee
Copy link
Collaborator Author

你是 win 10 什么版本?

@HQLIE2018
Copy link

专业版的

@johnsonlee
Copy link
Collaborator Author

试试:

echo Y | cacls app/build/bin/cwebp.exe /t /p everyone:f

或者:

echo yes | cacls app/build/bin/cwebp.exe /t /p everyone:f

@HQLIE2018
Copy link

echo yes | cacls app/build/bin/cwebp.exe /t /p everyone:f
是否确定(Y/N)?
echo Y | cacls app/build/bin/cwebp.exe /t /p everyone:f
是否确定(Y/N)?
结果是一样,直接在sutdio的Terminal跑没问题吧?

@johnsonlee
Copy link
Collaborator Author

echo yes | cacls app/build/bin/cwebp.exe /t /p everyone:f
是否确定(Y/N)?
echo Y | cacls app/build/bin/cwebp.exe /t /p everyone:f
是否确定(Y/N)?
结果是一样,直接在sutdio的Terminal跑没问题吧?

应该是一样的

@HQLIE2018
Copy link

如果在打包时没有做选择,引入的插件会不会生效?

@johnsonlee
Copy link
Collaborator Author

不会

@HQLIE2018
Copy link

就是必须要选择Y才会有效果?

@johnsonlee
Copy link
Collaborator Author

这 是个 bug,原来的设计是自动选择 Y,但是看起来 cacls 这个命令在 windows 不同的机器上的表现不太一样

@HQLIE2018
Copy link

好的,到时fix了的话,麻烦通知一声,谢谢!

@johnsonlee
Copy link
Collaborator Author

johnsonlee commented Jul 12, 2019

好的,到时fix了的话,麻烦通知一声,谢谢!

OK

@johnsonlee
Copy link
Collaborator Author

Booster v0.21.3 is available

@HQLIE2018
Copy link

Booster v0.21.3 is available
这个版本fix了之前“是否确定(Y/N)?”这个问题吗?

@johnsonlee
Copy link
Collaborator Author

Booster v0.21.3 is available
这个版本fix了之前“是否确定(Y/N)?”这个问题吗?

是的

@HQLIE2018
Copy link

是自动选择的还是需要手动输入

@johnsonlee
Copy link
Collaborator Author

是自动选择的还是需要手动输入

自动

@HQLIE2018
Copy link

是自动选择的还是需要手动输入

自动

好的,谢谢!

@johnsonlee
Copy link
Collaborator Author

是自动选择的还是需要手动输入

自动

好的,谢谢!

能正常使用了吗?

@HQLIE2018
Copy link

是自动选择的还是需要手动输入

自动

好的,谢谢!

能正常使用了吗?

导入booster-task-compression这个库后,使用0.21.3这个版本与之前的版本相比,都是能够对资源实现压缩的,都是在自动选择的情况下进行的

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

3 participants