Link to home
Start Free TrialLog in
Avatar of jxbma
jxbmaFlag for United States of America

asked on

How do I set the minimum api level for projects in Android Studio?

Hi:

I'm a newbie to the world of Android, Android Studio and gradle.

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);

Open in new window


I see the following error message:
Call requires API level 11 (current min is 7)

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" />

Open in new window


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?

Thanks,
JohnB
Avatar of Wasim_Haider
Wasim_Haider
Flag of Bangladesh image

You can delete the 'apk' manually and try rebuild the project again.
Avatar of jxbma

ASKER

Not sure what you mean by delete the API manually.
Can you be more specific?

Thanks,
JohnB
ASKER CERTIFIED SOLUTION
Avatar of Wasim_Haider
Wasim_Haider
Flag of Bangladesh image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial