如何设置在Android的Studio项目的最低API级别? [英] How do I set the minimum api level for projects in Android Studio?

查看:2792
本文介绍了如何设置在Android的Studio项目的最低API级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近迁移一个项目到Android的工作室0.4.3。 编译时,它给我的错误在几个行的Java,包括以下内容:

I recently migrated a project into Android Studio 0.4.3. When compiling, it gave me errors on several lines of java, including the following:

FragmentManager fm = getFragmentManager();

fm.findFragmentById()

@Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

getResources().getStringArray(R.array.course_descriptions); 

我看到了以下错误消息:

I see the following error message:

Call requires API level 11 (current min is 7)

我运行Android工作室.0.4.3。我也通过SDK管理器中下载的Andr​​oid 4.4.2(API 19)。

I'm running Android Studio .0.4.3. I also downloaded Android 4.4.2 (API 19) through the SDK manager.

我添加下面一行到我的清单:

I added the following line to my manifest:

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" /> 

我做了一个同步工程与摇篮文件,清理和重建项目。 我仍然看到了同样的错误。

I did a "Sync Project with Gradle files", cleaned and rebuilt the project. I still see the same errors.

我该如何解决这个问题?

How do I fix this issue ?

推荐答案

我有0.8.6版本,它可以这样做:

I have 0.8.6 version and it's can be done like this:

在菜单:文件 - >项目结构

In the menu: File -> Project Structure.

在打开的菜单,导航到应用,然后在选项卡中选择香精

In the open menu, navigate to app, then in the tabs choose Flavors.

这篇关于如何设置在Android的Studio项目的最低API级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆