-5

我收到以下错误: “摇篮问题与Android 2.3.3工作室

The SDK platform tools version (25.0.6) is too old to check APIs compiled with API 26; please update This check scans through all ANDroid API calls in the application and warns about any calls that are not available on all versions targeted by the application (according to its minimum SDK attribute in the manifest). If you really want to use this API and don’t need to support older devices just set the minSdkVersion in the build.gradle or AndroidManifest.xml files If your code is deliberately accessing newer APIs and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate you class or method with the @TargetApi annotation specifying the local minimum SDK to Apply, such as @TargetApi(11), such that this check considers 11 rather than you manifest file’s minimum SDK as the required API level. If you are deliberately setting android: attributes in style definitions, make sure you place this in values-xxx folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with new ones or later platforms. Similarly, you can use tooltargetApi=”11” in an XML file to indicate that the elements will only be inflated in an adequate context."

我也得到了包的名字往上顶为一个错误,但我刚刚创建的新的应用程序即使它表示错误的源代码编译和运行在目标设备上的模拟器

+1

您是否在发布之前首先阅读了错误消息并提出了修复建议? –

+0

step1。读取错误信息 –

+0

step2。固定。也许它的工作 –

回答

1

转到您的应用级摇篮文件并输入以下内容:。

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 26 
 
    buildToolsVersion '26.0.0' 
 

 
    defaultConfig { 
 
    applicationId ">>>YOURPACKAGENAME<<<" 
 
    minSdkVersion 16 
 
    targetSdkVersion 26 
 
    versionCode 1 
 
    versionName "1.0" 
 
    } 
 
    buildTypes { 
 
    release { 
 
     minifyEnabled false 
 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
    } 
 
    } 
 
}