Circle CI整合 [英] Circle CI Integration

查看:62
本文介绍了Circle CI整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是想将Android应用程序与CircleCI集成。

I am basically going mental trying to integrate an Android app with CircleCI.

根据文档,我具有以下2.0版配置文件。

I have the following Version 2.0 config file as per documentation.

version: 2

jobs:
  build:
    docker:
      - image: circleci/openjdk:8-jdk

      working_directory: ~/repo

      environment:
        ANDROID_HOME: /usr/local/android-sdk-linux
        JVM_OPTS: -Xmx3200m
        TERM: dumb

     dependencies:
       pre:
         - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-23.0.1,android-23,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-libs/android-support-v7-cardview.jar,extra-libraryForFloatingButton,extra-libs/engine.io-client-0.5.0.jar,extra-libs/httpmime-4.2.5.jar,extra-libs/okhttp-2.3.0.jar,extra-libs/okhttp-ws-2.3.0.jar,extra-libs/okio-1.3.0.jar,extra-libs/socket.io-client-0.5.0.jar,extra-com.crashlytics.sdk.android:crashlytics:2.5.5@aar
         - chmod +x gradlew
         - ANDROID_HOME = /usr/local/android-sdk-linux ./gradlew dependencies

    steps:
      - checkout
      - run: gradle dependencies    
      - run: gradle test

我现在收到如下错误。我找不到针对此的任何解决方案以及CircleCI Config 2.0的任何可靠模板。

I am now getting an error like below. I am not able to find any solution for this as well as any solid template for CircleCI Config 2.0.

NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  
It is currently set to /usr/local/android-sdk-linux/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/usr/local/android-sdk-linux' does not exist.


推荐答案

您似乎没有使用正确的Docker映像安卓每个文档应为:

Looks like you aren't using correct Docker image for Android. Per documentation it should be:

docker:
  - image: circleci/android:api-25-alpha

或预装有Android SDK的某种形式。 此处可用的Docker映像列表。

Or something of the sort that has Android SDK pre-installed. Here's the list of available Docker images.

这是我上面发布的链接中的示例配置:

Here is a sample config from the link I posted above:

version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      - 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 Tests
          command: ./gradlew lint test
      - store_artifacts:
          path: app/build/reports
          destination: reports
      - store_test_results:
          path: app/build/test-results

这篇关于Circle CI整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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