Partage
  • Partager sur Facebook
  • Partager sur Twitter

Android Studio : problème compilation

The application's minSdkVersion is newer than the device API level.

    20 janvier 2021 à 7:42:04

    J'ai fait une modifcation dans mon code en ajoutant une seconde activité et maintenant plus rien ne fonctionne.

    J'ai tenté de revenir en arrière, mais j'ai toujours le même problème.

    Si quelqu'un a une idée...

    Je développe pour une tablette avec le deviceSdk API26.

    01/20 07:14:24: Launching 'app' on 10.1  WXGA (Tablet) API 26.
        Installation did not succeed. The application could not be installed:
        INSTALL_FAILED_OLDER_SDK
        List of apks: [0]
        'C:\Users\Moi\Desktop\EscapeGameSTW\app\build\outputs\apk\debug\app-debug.apk'
        The application's minSdkVersion is newer than the device API level.

    The AndroidiManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.myapplication">
    
        <uses-permission android:name="android.permission.WAKE_LOCK" />
    
        <uses-feature android:name="android.hardware.type.watch" />
    
    
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <uses-library
                android:name="com.google.android.wearable"
                android:required="true" />
    
            <!--
                   Set to true if your app is Standalone, that is, it does not require the handheld
                   app to run.
            -->
            <meta-data
                android:name="com.google.android.wearable.standalone"
                android:value="true" />
    
            <activity
                android:name=".MainActivity"
                android:screenOrientation="landscape">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
    </manifest>

    The build.gradle file

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 29
    
        defaultConfig {
            applicationId "com.example.myapplication"
            minSdkVersion 27
            targetSdkVersion 29
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation fileTree(dir: "libs", include: ["*.jar"])
        implementation 'androidx.appcompat:appcompat:1.2.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
        implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'com.google.android.material:material:1.2.1'
        implementation 'androidx.navigation:navigation-fragment:2.3.1'
        implementation 'androidx.navigation:navigation-ui:2.3.1'
        implementation 'androidx.wear:wear:1.0.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.2'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
        compileOnly 'com.google.android.wearable:wearable:2.5.0'
    
    }

    Merci

    Max

    • Partager sur Facebook
    • Partager sur Twitter
      20 janvier 2021 à 9:51:46

      Ton sdkmin est 27 alors que ta tablette est en 26
      • Partager sur Facebook
      • Partager sur Twitter

      Android Studio : problème compilation

      × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
      × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
      • Editeur
      • Markdown