如何在 Android Studio 中为项目设置最低 api 级别?

如何在 Android Studio 中为项目设置最低 api 级别?

问题描述:

我最近将一个项目迁移到 Android Studio 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); 

我看到以下错误消息:

Call requires API level 11 (current min is 7)

我正在运行 Android Studio .0.4.3.我还通过 SDK 管理器下载了 Android 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" /> 

我做了一个使用 Gradle 文件同步项目",清理并重建了项目.我仍然看到相同的错误.

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.

在打开的菜单中,导航到 app,然后在选项卡中选择 Flavors.

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