Android Studio-无法在设备minSdk(API 23,N)上运行应用程序!=设备Sdk(API 22) [英] Android Studio - Unable to run app on device minSdk(API 23, N) != device Sdk(API 22)
问题描述
因此,我在计算机上重新安装了linux,并且在重新安装android studio之后,我尝试获取一个写在手机上的应用程序,该应用程序以前不是问题.该应用程序针对的是具有API 16或更高版本的设备,但显然Android Studio现在具有称为N预览的功能,该功能不允许我在手机上运行任何内容.特别是当我按下运行按钮时,它告诉我
so i reinstalled linux on my computer and after i reinstalled android studio i tried getting an app that i wrote on to my phone which previously had not been a problem. The App ist targeted at devices with API 16 or higher but apparently Android Studio now features something called N preview which does not let me run anything on my phone. specifically when i hit the run button it tells me that
minSdk(API 23,N)!=设备Sdk(API 22)
minSdk(API 23, N) != device Sdk(API 22)
我知道目标API似乎设置不正确,但是当我启动项目时,我将其设置为16.现在我该如何解决呢?还有什么最干净的方法可以更改项目上的目标API?我只是更改构建标记吗?
i know this seems as though the target API isnt set correctly but when i started the project i set it to 16. Now how do i get around this? Also whats the cleanest way to change the target API on a project? Do i just change the build gradle?
非常感谢!
应用gradle文件:
app gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-N'
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.josias.myapplication"
minSdkVersion 16
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.+'}
推荐答案
更改
compileSdkVersion 'android-N'
至compileSdkVersion 22
和targetSdkVersion 'N'
至targetSdkVersion 22
这篇关于Android Studio-无法在设备minSdk(API 23,N)上运行应用程序!=设备Sdk(API 22)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!