Android studio 主活动未在AdroidManifest.xml中声明
每次我尝试启动我的应用程序时,都会出现以下错误 我已经尝试在启动选项中指定活动,禁用即时运行,并在清单中更改主启动程序活动(以及启动选项),将其设置为默认活动,但没有任何效果 这一切都是从我在清单中添加“产品页面”活动开始的,这是com.android.feature和com.android.application的实现:Android studio 主活动未在AdroidManifest.xml中声明,android-studio,android-manifest,android-launcher,Android Studio,Android Manifest,Android Launcher,每次我尝试启动我的应用程序时,都会出现以下错误 我已经尝试在启动选项中指定活动,禁用即时运行,并在清单中更改主启动程序活动(以及启动选项),将其设置为默认活动,但没有任何效果 这一切都是从我在清单中添加“产品页面”活动开始的,这是com.android.feature和com.android.application的实现: implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.google.fi
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.app.coffeehour.coffee_hour">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="@string/app_name"
android:supportsRtl="true"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true">
<activity android:name=".home.Home"
android:theme="@style/CustomTheme"
android:noHistory="true"
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=".navigation.ActivityOne"
android:theme="@style/CustomTheme"
android:label="@string/app_name">
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="coffeehour.app.com.br"
android:pathPattern="/.*"
android:scheme="https" />
</intent-filter>
</activity>
<activity android:name=".navigation.ActivityTwo"
android:theme="@style/CustomTheme">
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="coffeehour.app.com.br"
android:pathPattern="/.*"
android:scheme="https" />
</intent-filter>
</activity>
<activity android:name=".navigation.ActivityThree"
android:theme="@style/CustomTheme"
android:noHistory="true">
<intent-filter android:order="1">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="coffeehour.app.com.br"
android:pathPattern="/.*"
android:scheme="https" />
</intent-filter>
</activity>
<!-- Products Page -->
<activity
android:name=".products.OpenScreen">
</activity>
<activity
android:name=".products.NewUser"
android:screenOrientation="portrait" />
<activity
android:name=".products.MainAppPage"
android:label="@string/title_activity_main_app_page"
android:screenOrientation="portrait"
android:theme="@style/CustomTheme" />
<activity
android:name=".products.IndividualProduct"
android:label="@string/title_activity_individual_product"
android:screenOrientation="portrait"
android:theme="@style/CustomTheme" />
<activity android:name=".products.ShoppingCartWindow" />
<activity android:name=".products.CheckOutScreen" />
<activity android:name=".products.ForgotPassword" />
<activity android:name=".products.IndividualProductSeller" />
<activity android:name=".products.AddProductForm"></activity>
</application>
</manifest>
实现'com.squareup.picasso:picasso:2.71828'
实现'com.google.firebase:firebase数据库:16.0.1'
实现'com.google.firebase:firebase auth:16.0.3'
实现'com.google.firebase:firebase核心:16.0.3'
有时,当您更改android studio清单上的MainActivity时,它会从缓存中编译,因此问题的第一个解决方案是转到-文件无效缓存并重新启动将解决您的问题。我更喜欢发布代码而不是屏幕截图:
我已经发送了清单代码,以下是MainActivity包的名称:
package br.com.app.coffeehour.coffee_hour.home;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.ImageView;
import android.support.v7.widget.Toolbar;
import br.com.app.coffeehour.coffee_hour.R;
import br.com.app.coffeehour.coffee_hour.navigation.ActivityOne;
import br.com.app.coffeehour.coffee_hour.navigation.ActivityThree;
import br.com.app.coffeehour.coffee_hour.navigation.ActivityTwo;
@Livia Castilholi Santiago好的,请查看包名是否匹配,并仔细查看活动中拼写错误的活动,最后,如果可以,请将清单文件和mainactivity包的屏幕截图显示出来。