应用程序无法调试 android

Application not able to debugging android

Android Studio 无法开始调试我的应用程序。它输出消息

我的AndroidManifest.xml文件

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.xxx" >

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

<application
    android:debuggable="true"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:ignore="HardcodedDebugMode">
    <activity android:name="com.xxx.MainContentActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>

我的Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.xxx"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 2
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile 'com.android.support:recyclerview-v7:23.3.0'
    compile 'com.android.support:cardview-v7:23.3.0'
    compile 'com.google.android.gms:play-services:8.4.0'
}

我尝试 clean/rebuild gradle 项目,重新启动 Android Studio,使缓存无效,并重新启动 ADB 集成(工具 -> Android ->禁用 ADB 集成 -> 启用 ADB 集成)

有什么想法吗?

P.S. 在此之前我更改了应用程序包的名称

P.S.{2} Android Studio 无法调试其他项目。

执行以下步骤:

导航到工具 --> android --> 禁用 adb 集成并再次启用它

之后从设备上拔下 USB 并重新插入。

再次调试

结帐this link

希望这对您有所帮助。

两天后,我找到了 situation.Android Studio 调试新项目的唯一出路。因此,有必要删除具有修改包名称(代码存储)的旧项目,创建一个具有所需包名称和恢复代码的新项目。谢谢大家的回答和帮助。