Solved

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

Posted on 2014-01-29
3
2,674 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

Save on storage to protect fatherhood memories

You're the dad who has everything. This Father's Day, make sure your family memories are protected. My Passport Ultra has automatic backup and password protection to keep your cherished photos and videos safe. With up to 3TB, you have plenty of room to hold the adventures ahead.

Question has a verified solution.

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

In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is an explanation of a simple data model to help parse a JSON feed
This video is in connection to the article "The case of a missing mobile phone (https://www.experts-exchange.com/articles/28474/The-Case-of-a-Missing-Mobile-Phone.html)". It will help one to understand clearly the steps to track a lost android phone.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now