Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2739
  • Last Modified:

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
0
jxbma
Asked:
jxbma
  • 2
1 Solution
 
Wasim_HaiderCommented:
You can delete the 'apk' manually and try rebuild the project again.
0
 
jxbmaSoftware ConsultantAuthor Commented:
Not sure what you mean by delete the API manually.
Can you be more specific?

Thanks,
JohnB
0
 
Wasim_HaiderCommented:
Not API, delete 'apk' directory from 'build\apk\' and try again. Thanks.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now