Solved

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

Posted on 2014-01-29
3
2,697 Views
Last Modified: 2014-02-11
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
0
Comment
Question by:jxbma
  • 2
3 Comments
 
LVL 3

Expert Comment

by:Wasim_Haider
ID: 39820359
You can delete the 'apk' manually and try rebuild the project again.
0
 
LVL 1

Author Comment

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

Thanks,
JohnB
0
 
LVL 3

Accepted Solution

by:
Wasim_Haider earned 500 total points
ID: 39821035
Not API, delete 'apk' directory from 'build\apk\' and try again. Thanks.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
moto 4g plus phone applications 2 52
I tunes, androids and windows 10 3 42
spam sms 9 42
Andorid - Exchange Active Sync : Client Certificate Required 12 102
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A brand new malware strain was recently discovered by security researchers at Palo Alto Networks dubbed “AceDeceiver.” This new strain of iOS malware can successfully infect non-jailbroken devices and jailbroken devices alike.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question