Java Android studio:安装未成功。无法安装应用程序:安装失败\u旧的\u SDK

Java Android studio:安装未成功。无法安装应用程序:安装失败\u旧的\u SDK,java,android,Java,Android,我通过添加第二个活动对代码进行了修改,现在出现以下错误: 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\EscapeG

我通过添加第二个活动对代码进行了修改,现在出现以下错误:

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.
AndroidManifest.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>
我必须使用的设备是API26

我已经删除了修改,但错误仍然存在。 我已尝试将compileSdkVersion更改为26 如何恢复此错误


谢谢大家。

我发现了我的问题。这是因为图书馆是可穿戴的。拆下后,一切正常

<uses-library
        android:name="com.google.android.wearable"
        android:required="true" />


Max

您的手机
API级别低于项目的最低Sdk版本

在格拉德尔:

defaultConfig {
    applicationId "com.example.myapplication"
    //You have to decrease the minSdkVersion cause, your android's API level is lower than this. minSdkVersion used for from which API level of android you can use
    minSdkVersion 27
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
所以,试试看

minSdkVersion 20
如果可能的原因,它也必须与您的源代码兼容。只需根据android的API级别进行更改

minSdkVersion 20