简体   繁体   English

我有一个错误“调用要求API级别11(当前最小值为8)”。 这是我在项目(ECLISPE)中可以找到的

[英]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:minSdkVersionandroid: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.

相关问题 错误:调用需要API级别23(当前最小值为15): - Error : Call requires API level 23(current min is 15): 调用要求API级别21,当前最小值为8 - Call requires API level 21, current min is 8 调用需要API级别11(当前最小值为8)android.app.Activity#onCreateView - Call requires API level 11(current min is 8) android.app.Activity#onCreateView 调用需要API级别11(当前最小值为8):android.app.Activity#onCreateView FragmentActivity - Call requires API level 11 (current min is 8): android.app.Activity#onCreateView FragmentActivity 调用要求API级别16(当前最小值为14),并带有EndAction - Call requires API level 16 (current min is 14) withEndAction 错误:调用需要 API 级别 24(当前最小值为 21):java.util.Map#forEach [NewApi] - Error: Call requires API level 24 (current min is 21): java.util.Map#forEach [NewApi] 如何修复 Android 中的“呼叫需要 API 级别 26(当前最小值为 25)”错误 - How to fix "Call requires API level 26 (current min is 25) " error in Android 需要API级别21(当前最小值为16) - Requires API level 21 (current min is 16) 调用需要 API 级别 23(当前最小值为 22)同时从应用程序发出调用请求 - Call requires API level 23 (current min is 22) While making a call request from App 调用需要API级别26(当前最小值为23):java.time.Instant#now - Call requires API level 26 (current min is 23): java.time.Instant#now
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM