简体   繁体   English

命令“ echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a”失败,并在执行过程中以1退出

[英]The command “echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a” failed and exited with 1 during

Am new with Travis alongside android development, my build is failing because of the error title I indicated, I have been reading the documentation and I tried to implement it, but still, the build is failing. Travis是Android开发中的一个新功能,由于我指出的错误标题,我的构建失败了,我一直在阅读文档,并尝试实现它,但仍然失败。

The link to my failing build is as below https://travis-ci.org/huxaiphaer/ConvergeLevelApp 我失败的构建的链接如下https://travis-ci.org/huxaiphaer/ConvergeLevelApp

Below is the error on Travis. 以下是Travis上的错误。

$ java -Xmx32m -version

java version "1.8.0_144"

Java(TM) SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

$ javac -J-Xmx32m -version

javac 1.8.0_144

0.46s$ echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a

Error: Target id is not valid. Use 'android list targets' to get the target ids.

The command "echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a" failed and exited with 1 during .

Your build has been stopped.

Link to the build 链接到构建

Then below is my .travis.yml file 然后下面是我的.travis.yml文件

    # Disabling sudo moves build to the Container Based Infrastructure on Travis CI

language: android
jdk: oraclejdk8

env:
  global:
    # wait up to 10 minutes for adb to connect to emulator
    - ADB_INSTALL_TIMEOUT=10

android:
  components:
    # Uncomment the lines below if you want to
    # use the latest revision of Android SDK Tools
    - platform-tools
    - tools

    # The BuildTools version used by your project
    - build-tools-26.0.2

    # The SDK version used to compile your project
    - android-26
    - extra
    # Additional components
    - extra-google-google_play_services
    - extra-google-m2repository
    - extra-android-m2repository
    - extra-android-support

    # Specify at least one system image,
    # if you need to run emulator(s) during your tests
    - sys-img-armeabi-v7a-android-22

  licenses:
    - 'android-sdk-preview-license-52d11cd2'
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

# start Android emulator

bedfore_install:
  - yes | sdkmanager "platforms;android-22"
  - ./gradlew build connectedCheck
  - chmod +x ./gradlew

before_script:
  - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
  - emulator -avd test -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &

notifications:
  email: true

cache:
  directories:
    - $HOME/.m2
    - $HOME/.gradle
    - $HOME/.android
    - ${TRAVIS_BUILD_DIR}/gradle/caches/
    - ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/

One of the solutions I implemented was to list the target ids , with the following command in the before_script : 我实现的解决方案之一是使用before_script的以下命令列出目标ID

 - android list targets

and I got the following list of them, but I don't know : 我得到了以下列表,但我不知道:

错误图片

This is my build.gradle file 这是我的build.gradle文件

apply plugin: 'com.android.application'
apply plugin: 'jacoco'


jacoco {
    toolVersion = '0.8.0'
}

tasks.withType(Test) {
    jacoco.includeNoLocationClasses = true
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {

    reports {
        xml.enabled = true
        html.enabled = true
    }

    def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
    def debugTree = fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: fileFilter)
    def mainSrc = "$project.projectDir/src/main/java"

    sourceDirectories = files([mainSrc])
    classDirectories = files([debugTree])
    executionData = fileTree(dir: project.buildDir, includes: [
            'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
    ])
}


android {

    adbOptions {
        timeOutInMs 60 * 1000
    }

    compileSdkVersion 28
    defaultConfig {
        applicationId "com.levelapp.converge.convergelevelapp"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        debug {
            testCoverageEnabled true
        }

        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    testOptions {
        execution 'ANDROID_TEST_ORCHESTRATOR'
        animationsDisabled true

        unitTests {
            includeAndroidResources = true
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:exifinterface:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    androidTestUtil 'com.android.support.test:orchestrator:1.0.2-alpha1'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.robolectric:robolectric:3.7.1'
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.koushikdutta.ion:ion:2.+'
    implementation 'com.mikhaellopez:circularimageview:3.2.0'
}

Seems you forgot to add emulator dependency and that's why no valid ABI is found. 似乎您忘了添加仿真器依赖性,这就是为什么找不到有效的ABI的原因。 To run the emulator you need to install the android-22 platform for emulator to works: 要运行模拟器,您需要安装android-22平台才能使模拟器正常工作:

android: 
  components: 
    - ...
    # Specify at least one system image,
    # if you need to run emulator(s) during your tests
    - android-22
    - sys-img-armeabi-v7a-android-22
    - ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Aptana 错误:解析 android-22 的数据失败 - Aptana error: parsing data for android-22 failed 错误:无法使用哈希字符串'android-22'找到目标 - Error :failed to find target with hash string 'android-22' 添加 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }' 后,Android 应用程序不兼容 64 位 - Android app not 64 bit compliant after adding 'ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' }' Android 应用程序在添加 NDK 后不兼容 64 位 { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' } - Android app not 64 bit compliant after adding NDK { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' } 为armeabi编译的文件在armeabi-v7a上是否存在一些问题 - Do files compiled for armeabi have some problems with armeabi-v7a Android NDK:不推荐使用的应用程序目标ABI:更新NDK后的armeabi错误 - Android NDK: Application targets deprecated ABI(s): armeabi error after update NDK 调色板(Android支持v22)不会生成色板 - Palette (Android Support v22) doesn't generate Swatches Android API 15,无法创建新的AVD - Android API 15, can't create a new AVD Android SDK]加载SDK时出错:错误:解析C:\\ Users \\ Atul Rai \\ android-sdks \\ system-images \\ android-22 \\时出错 - Android SDK] Error when loading the SDK: Error: Error parsing C:\Users\Atul Rai\android-sdks\system-images\android-22\ 如何在Android AVD中测试传感器应用程序? - How to test sensor application in android AVD?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM