[英]I have an error “Call requires API level 11 (current min is 8)”. This is what I can find in my project (ECLISPE)
I try to make a 'done' button at my app. 我尝试在我的应用上创建一个“完成”按钮。 (according to a book)
(根据一本书)
At first, when I make a new app 'Hellow wordl!', there was no problem 首先,当我制作一个新应用“ Hellow wordl!”时,没有问题
but, now I add some lines in " TestAndroidMainActivity.java ", 但是,现在我在“ TestAndroidMainActivity.java ”中添加了几行,
it doesn't work. 它不起作用。 What should I do?
我该怎么办?
这意味着您在代码中使用的某些方法要求的最低SDK版本为11。您可以在清单文件中将minSDK更改为11。
You can try increasing the minsdkversion in gradle from 8 to 11, but if you are bent on supporting devices using api version less 11, then you will be restricted to use only limited resources from the sdk because of this restriction. 您可以尝试将gradle中的minsdkversion从8增加到11,但是如果您倾向于使用api version 11以下的支持设备,则由于此限制,您将只能使用sdk中有限的资源。 By changing from minsdkversion 8 to 11 you won't be losing much customer base, because a very small percentage of the android device users population is using devices that has OS version below Android gingerbread 2.2, hell you can even set your minsdkversion to 16 and cover more than 90% of the android user base
通过将minsdkversion 8更改为11,您将不会失去太多的客户群,因为只有极少数的android设备用户正在使用操作系统版本低于Androidgingbread 2.2的设备,您甚至可以将minsdkversion设置为16和覆盖超过90%的android用户群
Just go into you AndroidManifest.xml 只需进入您的AndroidManifest.xml
over there change the values for android:minSdkVersion and android:targetSdkVersion 在那边更改android:minSdkVersion和android:targetSdkVersion的值
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bd.redrover"
android:versionCode="1"
android:versionName="1.0" >
/// MAKE YOUR CHANGES OVER HERE
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="23" />
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.test.SpalshScreenActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Let me know if this works! 让我知道这个是否奏效! :)
:)
The answer is in your error line itself. 答案就在您的错误行本身中。 The only thing it requires is higher level of SDK and you can change it from your manifest file easily.
它唯一需要的是更高级别的SDK,您可以轻松地从清单文件中进行更改。 Good luck!!
祝好运!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.