Unable to attach debugger in Android Studio - localhost:8600 java.net.ConnectException

前端 未结 11 2204
不思量自难忘°
不思量自难忘° 2021-02-07 00:35

I cannot attach the debugger in Android Studio while running debug on a phone.

I’m currently using a Samsung S4, running Android 4.4.4 (but have tried an S5, S6, S7, and

11条回答
  •  自闭症患者
    2021-02-07 01:35

    Support for a true debug build. Developers no longer need to add the android:debuggable attribute to the tag in the manifest — the build tools add the attribute automatically. In Eclipse/ADT, all incremental builds are assumed to be debug builds, so the tools insert android:debuggable="true". When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts the android:debuggable="true" attribute, while ant release does not. If android:debuggable="true" is manually set, then ant release will actually do a debug build, rather than a release build.

    In my case i struggling this issue with 5 hour and found that the

    minifyEnabled true is the main culprit so change minifyEnabled false work for me

    My app build.gradle file look like

     buildTypes {
            debug {
                signingConfig signingConfigs.debug
                minifyEnabled false
                shrinkResources true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
    
        }
    

提交回复
热议问题