I cannot create a new Activity

Asked

Viewed 86 times

1

I’m doing a project that uses the v4 support jar. However, when I create a new Activity, the project gets errors, as it informs that support v7 is required. There is possibility to continue developing this project using only v4, or it has been discontinued and is now only possible using v7?

Here’s my Android_manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="br.exemploactionbar"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Holo.Light" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".NoticeActivity"
            android:label="@string/title_activity_notice" >
        </activity>
        <activity
            android:name=".TesteActivity"
            android:label="@string/title_activity_teste" >
        </activity>
    </application>

</manifest>
  • Try using v7.appCompact instead of standard v7.

  • 1

    I was able to correct by creating a new project, and exporting the classes from the previous project.

1 answer

1

If you are including support v4 e bibliotecas AppCompat v7 in your application, you must specify a minimum version SDK de 7 (and not 4).

The highest level of the support library you include in your application determines the lowest version of the API it can operate on.

Source

Browser other questions tagged

You are not signed in. Login or sign up in order to post.