AndroidManifest.xml中未声明活动“MainMenu”[尽管它是]

时间:2015-05-28 08:26:03

标签: android xml android-activity apk android-manifest

所以,我遇到了这个错误,现在我甚至无法编译代码!我不得不重命名包,因为它无法上传APK,因为它是默认的com.example [...] specificaton。因此,我根据本教程https://www.youtube.com/watch?v=_7-bvkRthWM重命名了包,所有内容都搞得很糟糕。

这是我的AndroidManifest.xml,因为你可以看到定义了MainMenu的活动:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.done.samuelh.josethepig" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"

        android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        <!--android:theme="@android:style/Theme.Black.NoTitleBar">
     android:theme="@style/Theme.AppCompat" - dark original background-->
        <activity
            android:name="com.done.samuelh.josethepig.MainMenu"
            android:label="@string/app_name"
            android:configChanges="orientation"
            android:screenOrientation="sensorLandscape">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.done.samuelh.josethepig.Game"
            android:label="@string/title_activity_game"
            android:configChanges="orientation"
            android:screenOrientation="sensorLandscape">

        </activity>
    </application>

</manifest>

这是我的build.gradle ......

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.done.samuelh.josethepig"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

一切,但发布APK在该教程之前工作得很好,现在我真的陷入了完整的游戏......

如何解决这个令人讨厌的错误?

0 个答案:

没有答案
相关问题