Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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.
By this time the large percentage of day-to-day transactions have shifted to mobile banking; here are some overriding areas QAs must investigate while testing mobile banking apps.  
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.
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.

757 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

19 Experts available now in Live!

Get 1:1 Help Now