彩虹帽android东西minsdk = 24错误

时间:2018-07-18 13:43:46

标签: android android-things

我正在使用pimoroni的android事物和Rainbow Hat使用Raspberry pi 3 B上的LED指示灯闪烁创建测试应用程序,但是当我尝试过时,它说

Manifest merger failed : uses-sdk:minSdkVersion 24 cannot be smaller than version 27 declared in library [com.google.android.things.contrib:driver-rainbowhat:1.0] C:\Users\LENOVO-PC\.gradle\caches\transforms-1\files-1.1\driver-rainbowhat-1.0.aar\d5f46e61011d32f9fa318c0bb291f09a\AndroidManifest.xml as the library might be using APIs not available in 24
    Suggestion: use a compatible library with a minSdk of at most 24,
        or increase this project's minSdk version to at least 27,
        or use tools:overrideLibrary="com.google.android.things.contrib.driver.rainbowhat" to force usage (may lead to runtime failures)

我的应用程序优先级是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.lenovo_pc.anythingtesting"
        minSdkVersion 24
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

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

dependencies {
    implementation fileTree(include: ['*.jar', '*.so'], dir: 'libs')
    //   implementation 'com.google.android.things.contrib:driver-apa102:0.3'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.android.things.contrib:driver-rainbowhat:1.0'
    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'
       compileOnly 'com.google.android.things:androidthings:1.0'

}

apply plugin: 'com.google.gms.google-services'

我的androidmanifest.xml是

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.lenovo_pc.anythingtesting">

    <uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!--   <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.READ_PHONE_STATE" />  -->



      <application

          android:extractNativeLibs="false"


          android:label="@string/app_name">
          <uses-library android:required="false" android:name="com.google.android.things"/>
          <!--               android:required="false"
                        tools:replace="android:required"  -->


                    <activity android:name=".innovatrics.MainActivity">
                        <meta-data android:name="android.app.lib_name" android:value="blink" />
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN" />
                            <category android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>
                        <!--
                                    <intent-filter>
                                        <action android:name="android.intent.action.MAIN" />

                                        <category android:name="android.intent.category.IOT_LAUNCHER" />
                                        <category android:name="android.intent.category.DEFAULT" />
                                    </intent-filter>
                                    -->
                    </activity>
                </application>


            </manifest>

我正在Raspberry pi 3 B中运行该应用程序,并且我看过不同的教程,minsdkversion在24上还可以。所以我不确定我的代码有什么问题

1 个答案:

答案 0 :(得分:3)

您正在看一个过时的教程。 minSdk从2017年11月29日的24 to 26和2018年3月22日的26 to 27起提高。

您必须立即使用minSdk 27​​ +。