Robotium:请安装兼容的 Android API 级别(15 或更高) [英] Robotium: Please install a compatible Android API level (15 or higher)

查看:48
本文介绍了Robotium:请安装兼容的 Android API 级别(15 或更高)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行新的 Robotium 测试时出现此错误.有大佬知道怎么解决吗?

我拥有所需的所有 API.(15 和许多更高的 API).我错过了什么?

这是我的 gradle 文件的一部分:

android {compileSdkVersion 25构建工具版本25.0.2"默认配置{applicationId "com.centervue.exam"minSdkVersion 19目标SDK版本25//请勿在此处输入版本名称 THX.更改清单testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"ndk{模块名称exam_filter"ldLibs日志",jnigraphics"}渲染脚本TargetApi 18renderscriptSupportModeEnabled true}[...]

更新:在将每个支持库版本从 25+ 或 + 更改为至少 25.+ 以避免混合库之后......它可以工作并启动.虽然现在我收到这条消息:

JavaCompile.setDependencyCacheDir() 方法已被弃用,并计划在 Gradle 4.0 中移除.增量 Java 编译是一个孵化功能.FAILURE:构建失败,出现异常.* 出了什么问题:配置根项目executorproject"时出现问题.> org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection 无法转换为 org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection * 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.构建失败总时间:1.883 秒

有什么想法吗?我想我们快到了.

解决方案

  1. 在您的项目/android 面板中,按 F4 打开项目结构.选择 SDK 位置 并检查 Android SDK 位置路径是否与您将 API 下载到的 SDK 安装相同.

  2. 确保模拟器或设备至少安装了 API 15 (>= ICE_CREAM_SANDWICH_MR1)

  3. 确保您的 SDK 中提供与您的设备完全相同的 API:

<块引用>

用户指南:确保Android SDK 管理器中提供了所连接设备或模拟器的 Android API 级别

  1. 打开你的 Module Gradle 文件并确保 compileSdkVersion &targetSdkVersion(可能还有 minSdkVersion & buildToolsVersion)versiona 至少为 15

  2. (为了未来读者的利益)确保你有一个测试设置来运行,否则你没有选择

Trying to run a new robotium test I get this error. Does anyone know how to fix it?

I've all the APIs needed. (15 and a lot of higher APIs). What am I missing?

This is part of my gradle file:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.centervue.exam"
        minSdkVersion 19
        targetSdkVersion 25
        // DO NOT PUT HERE VERSION NAME, THX. Change the Manifest

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        ndk {
            moduleName "exam_filter"
            ldLibs "log", "jnigraphics"
        }
        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true
    }
[...]

UPDATE: after changing every support library versions from 25+ or + to at least 25.+ to avoid mixed libraries... it works and starts. Although now I get this message:

The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0. Incremental java compilation is an incubating feature. FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'executorproject'. > org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 1.883 secs

Any idea? We are almost there I think.

解决方案

  1. From your project/android panel, press F4 to open the project structure. Select SDK Location and check that the Android SDK location path is in fact the same SDK installation you have downloaded your API's to.

  2. Make sure the Emulator or device has at least API 15 installed (>= ICE_CREAM_SANDWICH_MR1)

  3. Ensure the exact same API is available in your SDK as your device:

User Guide: Make sure the Android API level of the connected device or emulator is available in the Android SDK Manager

  1. Open your Module Gradle file and make sure that compileSdkVersion & targetSdkVersion (and maybe minSdkVersion & buildToolsVersion) versiona are at least 15

  2. (For the benefit of any future readers) Make sure you have a test set up for it to run, otherwise you don't have the option

这篇关于Robotium:请安装兼容的 Android API 级别(15 或更高)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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