【问题标题】:Application not able to debugging android应用程序无法调试android
【发布时间】:2016-09-17 17:52:25
【问题描述】:

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>

我的摇篮

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'
}

我尝试清理/重建 gradle 项目,重新启动 Android Studio,使缓存无效和 rebbot ADB 集成(工具 -> Android -> 禁用 ADB 集成 -> 启用 ADB 集成)

有什么想法吗?

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

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

【问题讨论】:

  • 从清单应用程序标签中删除 android:debuggable="true"...从设备上卸载应用程序(如果以前安装过)...然后再试一次。
  • 你说的我都做了。结果是一样的:(@ArnavM.
  • 它是否在模拟器/模拟器或其他设备上工作?
  • 我目前没有其他设备,也没有安装模拟器,但我注意到,Android Studio 无法调试其他项目。现在我将 AS 更新到 2.1.1 版并重试。 gragle build 进程也没有启动,当我点击图标调试时,只显示错误消息@ArnavM.
  • 分享你的gradle版本、gradle-android插件版本和java版本。

标签: android xml debugging android-studio adb


【解决方案1】:

两天后,我找到了摆脱困境的唯一方法。Android Studio 只调试新项目。因此,有必要使用修改过的包名称(存储的代码)删除旧项目,使用所需的包名称创建一个新项目并恢复代码。谢谢大家的回答和帮助。

【讨论】:

    【解决方案2】:

    执行以下步骤:

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

    从设备上拔下 USB 并再次插入。

    再次调试。

    结帐this link

    希望这会有所帮助。

    【讨论】:

    • 不,不幸的是,它没有帮助。此外,我之前尝试过“导航到工具 --> android --> 禁用 adb 集成并再次启用它”
    • 您是否尝试过与答案中提到的链接不同的答案?
    猜你喜欢
    • 2010-10-13
    • 1970-01-01
    • 2013-11-04
    • 1970-01-01
    • 2013-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-05
    相关资源
    最近更新 更多