我已经配置了Auto通过CircleCI将Apk文件部署到Google Play商店。现在,我刚刚面临导致构建失败的问题,并显示:
expected <block end>, but found BlockMappingStart
按照CircleCI site中的文章,我的.yml文件如下:
#Install android build tools, platforms
#Supported versions here https://circleci.com/docs/android
machine:
java:
version: openjdk8
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4608m -XX:+HeapDumpOnOutOfMemoryError"'
dependencies:
pre:
- echo y | android update sdk --no-ui --all --filter "tools"
- echo y | android update sdk --no-ui --all --filter "platform-tools"
- echo y | android update sdk --no-ui --all --filter "build-tools-24.0.0"
- echo y | android update sdk --no-ui --all --filter "android-24"
- echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"
- echo y | android update sdk --no-ui --all --filter "extra-google-google_play_services"
- echo y | android update sdk --no-ui --all --filter "extra-android-support"
- echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
- (./gradlew -version):
timeout: 360
override:
#- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
- export TERM="dumb"; if [ -e ./gradlew ]; then ./gradlew clean dependencies -stacktrace;else gradle clean dependencies -stacktrace;fi
#Pull any submodules
checkout:
post:
- git submodule init
- git submodule update
#-PdisablePreDex is a must else gradle just dies due to memory limit
#Replace
test:
override:
- (./gradlew assemble -PdisablePreDex -stacktrace):
timeout: 360
- cp -r ${HOME}/${CIRCLE_PROJECT_REPONAME}/app/build/outputs/apk/ $CIRCLE_ARTIFACTS
- emulator -avd circleci-android22 -no-audio -no-window:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# run tests against the emulator.
- ./gradlew connectedAndroidTest
#Deploy when tests pass
deployment:
release:
branch: master
commands:
-./gradlew publishApkRelease
-Dorg.gradle.project.track=alpha
staging:
branch: staging
commands:
- (./gradlew clean assembleStaging crashlyticsUploadDistributionStaging -PdisablePreFex):
timeout: 720
我已经设置了classpath并应用了一个插件:
apply plugin: 'com.github.triplet.play' // in app module
classpath 'com.github.triplet.gradle:play-publisher:1.1.4' // in project level
我尝试将命令更改为:
release:
branch: master
commands:
-(./gradlew publishApkRelease -Dorg.gradle.project.track=alpha):
timeout: 720
就像我在Crahlytic上所做的一样,但它仍然无法正常工作(自动释放到Crashlytic工作正常。)
请建议。 感谢。