【发布时间】:2018-09-03 04:06:28
【问题描述】:
我有一个 android 项目,我想通过在 CircleCI 2.0 中部署来构建和测试。
执行构建时出现错误
*$#!bin/bash -eo pipefail
.gradlew androidDependencies
/bin/bash: ./gradlew: No such file or directory
Exited with Code 127*
version: 2
jobs:
build:
working_directory: ~/AndroidDemo
docker:
# Android the primary container
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
#- restore_cache:
# key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
# - save_cache:
# paths:
# - ~/.gradle
# key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
#- run:
# name: Run UnitTest
# command: ./gradlew testDemoDebugUnitTest
- run:
name: Setup emulator
command: sdkmanager "system-images;android-24;default;armeabi-v7a" && echo "no" | avdmanager create avd -n test -k "system-images;android-24;default;armeabi-v7a"
- run:
name: Launch emulator
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel auto -verbose
background: true
- run:
name: Wait emulator
command: |
# wait for it to have booted
circle-android wait-for-boot
# unlock the emulator screen
sleep 30
adb shell input keyevent 82
- run:
name: Run EspressoTests
command: ./gradlew connectedDemoDebugAndroidTest
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
我已经在我的 config.yml 文件中设置了工作目录
// AndroidDemo 是我的项目所在的地方
working_directory: ~/AndroidDemo
【问题讨论】:
-
发布您的
config.yml。此外,您不必设置工作目录。 -
@JaredBurrows 上传了它。
-
@SnehPandya,感谢您的编辑
-
尝试删除该工作目录,您应该不需要使用它。 Circle 应该做一个 git clone,然后运行 gradlew。另一种简单的调试方法是在构建服务器上执行“ls”和“pwd”以查看您所在的位置。
-
@SheikhFaisalMiskhat :你成功了吗?我也面临同样的问题?