由于multidex/android错误,在Travis中构建失败? [英] Build failing in Travis due to multidex/android bug?

查看:68
本文介绍了由于multidex/android错误,在Travis中构建失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们没有在项目中使用构建工具"26.0.2".实际上,在我们的项目目录中执行grep -RF "26.0.2" . | grep -v android-profile不会返回除

We are not using build tools "26.0.2" in our project. In fact, doing a grep -RF "26.0.2" . | grep -v android-profile on our project directory does not return anything except for

./CBSandbox/build/intermediates/multi-dex/release/components.flags:-libraryjars /home/gabor/Android/Sdk/build-tools/26.0.2/lib/shrinkedAndroid.jar
./CBSandbox/build/intermediates/multi-dex/debug/components.flags:-libraryjars /home/gabor/Android/Sdk/build-tools/26.0.2/lib/shrinkedAndroid.jar

虽然这本身是伪造的,但它会导致Travis导致构建失败(Failed to find Build Tools revision 26.0.2,因为我们的.travis.yml指定了我们实际使用的ANDROID_BUILD_TOOLS_VERSION=27.0.3). 在多义处理过程中是否拉出了较早的工具版本是已知的multidex错误吗?还要注意,这不是在保护期间,因为CBSandbox的构建文件中有minifyEnabled false(输出中的-libraryjars让我觉得proguard).

That in itself is bogus though, and it causes Travis to fail our build (Failed to find Build Tools revision 26.0.2 since our .travis.yml specifies ANDROID_BUILD_TOOLS_VERSION=27.0.3 which we actually use). Is it a known multidex bug that an earlier tools version is pulled during multidexing? Note also that it's not during proguarding as CBSandbox has minifyEnabled false in its build file (-libraryjars in the output made me think of proguard).

我们使用gradle插件的最新版本,该插件默认为最新的构建工具.但是,即使我们手动指定了构建工具,它仍会在multidex期间尝试拉取较旧的版本.

We use the latest version of the gradle plugin which defaults to the latest build tools. But even if we manually specify the build tools, it still tries to pull an older version during multidex.

在Travis中,构建仍然失败,但是在本地和Travis调试环境中,构建成功:

the build is still failing in Travis, but locally and in the Travis debug environment it succeeds:

travis@travis-job-76d0d0f4-b465-4926-b6fd-6496bbea6835:~/build/ChartBoost/android-sdk$ ./gradlew :CBSandbox:assemble
...
Checking the license for package Android SDK Build-Tools 26.0.2 in /usr/local/android-sdk/licenses
License for package Android SDK Build-Tools 26.0.2 accepted.
Preparing "Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)".
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" ready.
Installing Android SDK Build-Tools 26.0.2 in /usr/local/android-sdk/build-tools/26.0.2
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" complete.
"Install Android SDK Build-Tools 26.0.2 (revision: 26.0.2)" finished.
...
BUILD SUCCESSFUL in 3m 3s

所以我想这既是Travis错误(通过SSH成功​​时在UI上失败)又是Android工具错误(无需要求就拉出旧的构建工具).

So I guess it's both a Travis bug (fails on the UI while succeeding via SSH) and an Android tools bug (pulls older build tools without asking for that).

推荐答案

请将该链接添加到已知的Multidex错误,并在打开的示例项目中重现该错误.

Please add the link to the known Multidex bug and reproduce the bug in an open sample project.

检查此问题,也许有帮助.

您可以将两者都添加到.travis.yml文件中:

you can add both in .travis.yml file:

android:
 components:
  - build-tools-26.0.2
  - build-tools-27.0.3

并在build.gradle文件中手动指定构建工具版本:

And manually specify the build tools version in your build.gradle file:

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

我不确定您是否已经这样做了

I'm not sure if you are already doing it:

但是,即使我们手动指定了构建工具,它仍然会尝试 在multidex期间拉旧版本.

But even if we manually specify the build tools, it still tries to pull an older version during multidex.

这篇关于由于multidex/android错误,在Travis中构建失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆