遇到这种问题,因为最低的sdk版本高于当前模拟器或者运行此程序的真机上android的版本,因此在build.gradle
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.imooc.systeminfo" minSdkVersion 19 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }配置文件中,将
minSdkVersion 19
修改成低于运行模拟器或者真机的android sdk版本即可