Android应用程序不在gitlab ci上构建

时间:2018-10-31 13:54:24

标签: android gradle continuous-integration gitlab-ci

Android应用程序成功构建了本地语言,但在ci上失败了。

例外

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> java.lang.reflect.InvocationTargetException (no error message)

CI脚本

    image: openjdk:8

    variables:
      ANDROID_COMPILE_SDK: "27"
      ANDROID_BUILD_TOOLS: "27.0.3"
      ANDROID_SDK_TOOLS: "4333796"

    cache:
      paths:
        - .gradle/wrapper
        - .gradle/caches
        - "sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip"

    before_script:
      - export GRADLE_USER_HOME=`pwd`/.gradle
      - apt-get --quiet update --yes
      - apt-get --quiet install --yes wget tar lib32stdc++6 lib32z1 unzip
      - if [[ $NEED_ANDROID_SDK -eq 1 ]] ; then wget -N 
    https://dl.google.com/android/repository/sdk-tools- 
   linux-${ANDROID_SDK_TOOLS}.zip ; fi
      - if [[ $NEED_ANDROID_SDK -eq 1 ]] ; then unzip -q sdk-tools- 
   linux-${ANDROID_SDK_TOOLS}.zip ; fi
      - if [[ $NEED_ANDROID_SDK -eq 1 ]] ; then echo y | 
    tools/bin/sdkmanager --install 
    "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null ; fi
      - if [[ $NEED_ANDROID_SDK -eq 1 ]] ; then export ANDROID_HOME=$PWD/ ; fi
      - export BUILD_NUMBER=$(git rev-list --count HEAD)
      - chmod +x ./gradlew

增加Java版本无济于事。也将--add-modules java.se.ee添加到环境变量中

0 个答案:

没有答案