Error: Activity class {} does not exist (only on specific phone)

Error: Activity class {} does not exist (only on specific phone)

我在真机小米4c上开发,没问题。然后突然(我猜是在系统更新之后)我 运行 进入这个错误,当我尝试 运行:

Uploading file to: /data/local/tmp/be.sebsob.red
Installing be.sebsob.red
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/be.sebsob.red"
Aborted 


Launching application: be.sebsob.red/be.sebsob.red.FullscreenActivity.
DEVICE SHELL COMMAND: am start  -n "be.sebsob.red/be.sebsob.red.FullscreenActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=be.sebsob.red/.FullscreenActivity }
Error type 3
Error: Activity class {be.sebsob.red/be.sebsob.red.FullscreenActivity} does not exist.

(这是一个新的 android studio 默认全屏应用,没有任何变化)

试过没有解决问题:

但是 当我 运行 这个应用程序在我的其他设备(小米 Mi2S)上工作正常。

AND 当我在 phone 上手动复制 .apk 时(它无法从 Android Studio 复制到 运行),它会安装运行 很好。 所以我想当 运行 从 Android Studio 到我的 phone 时,这一定是一个特定的问题?会不会是read/write访问权限错误? 有什么想法吗?

AndroidManifest.xml(默认,AndroidStudio新项目设置后未更改)

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".FullscreenActivity"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@style/FullscreenTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

build.gradle(模块:应用程序)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "be.sebsob.red"
        minSdkVersion 16
        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'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:support-v4:23.2.1'
}

谢谢

好的,经过长时间的研究,我发现它与我的 phone 上的 adb 无法正常工作有关 。我真的不知道为什么......但要了解更多信息,请查看此答案:

就我个人而言,重新安装另一个(较旧的)ROM 版本是解决我的问题的唯一办法。

我尝试了所有方法,但没有任何效果!!非常失望! 运行ning 在三星 S8 上 (Android V.8.0.0 API 26)。 只有一件事起作用了:

  1. 构建 APK(构建 -> 构建 APK)
  2. 使用正常 Android 文件传输
  3. 将 .apk 文件拖放到智能手机下载文件夹中
  4. 按下并安装 .apk(它会要求更改从未知来源安装的设置)
  5. 安装应用程序后,您将能够从 Android Studio 运行 进行调试。

我希望这能对某些人有所帮助,因为我花了一些时间才弄明白。 非常非常奇怪的是,在华硕和 Pixel2 上,所有这些都不是问题。我已经被删除并重新安装应用程序多个提示,只有在带有奥利奥的三星 S8 上这是一个问题,所以三星可能将包名称存储在某处,如果删除则您无法重新安装(我使用的删除方式是通过应用程序经理)。