java - Intent Activity 类不起作用

标签 java android android-emulator

嘿伙计们,我在尝试在 android studio 上运行我的应用程序的模拟器时遇到了问题。这是我收到的错误:

Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dre.appli/com.example.dre.appli_app.LoginActivity }
Error type 3
Error: Activity class {com.example.dre.appli/com.example.dre.appli_app.LoginActivity} does not exist.

我尝试了人们建议的一切,但没有成功。这是我的 list

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

    <!-- To auto-complete the email text field in the login form with the user's emails -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">



        <activity
            android:name=".LoginActivity"
            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=".CreateAccount"
            android:label="@string/title_activity_create_account"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="app.createaccount" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

</application>
</manifest>

最佳答案

我想您的LoginActivity有一个包com.example.dre.appli_app.LoginActivity

但是您的 list 包不同:

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.wheretas.appli_app">
...

尝试设置它com.example.dre.appli_app

关于java - Intent Activity 类不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35831644/

相关文章:

java - JTree 显示与子节点相同的节点

java - 在java中使用Set/TreeSet的平均时间复杂度是多少?

Android 将 ID 添加到布局

android - 溢出菜单显示在底部

java - 当它包含变音符号时解析 Java 中 URI 的主机

java - showDocument() 在使用 Java 7/Java 6u27 的 IE8 中不显示新窗口

android - 无法在 Genymotion 模拟器中获取 Firebase 通知

Android:为什么 BufferedReader 读取 EOF?

android - map 未进入模拟器 android api v2

android - 应用程序未安装在模拟器中,显示 "No Debuggable Processes"