Operation not permitted while attaching debugger

Viewed 124

there's an option to attach a debugger to an installed app from android studio

enter image description here

I used to use it but, recently I joined a new company and it's not working showing me that error after selecting the process

enter image description here

this is my Gradle code I've:

plugins {
    id("com.android.application")
    id("kotlin-android")
    id("kotlin-android-extensions")
    id("kotlin-kapt")
    id("androidx.navigation.safeargs")
    id("com.google.firebase.firebase-perf")
    id("com.google.firebase.crashlytics")
    id("com.google.firebase.appdistribution")
    id("com.github.triplet.play") version "2.8.0"
}

android {

    compileSdkVersion 30
    buildToolsVersion '30.0.3'
    ndkVersion '21.3.6528147'

    defaultConfig {
        ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
        applicationId "xxx.xxx.xxx"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode gitVersionCode
        versionName gitVersionName
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    testOptions {
        animationsDisabled = true
    }

    sourceSets {
        androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
    }

    signingConfigs {

        appGallery{
            keyAlias "XXXXX"
            keyPassword "XXXXX"
            storeFile file("XXXXX")
            storePassword "XXXXX"
        }

        playStore {
            keyAlias "XXXXX"
            keyPassword "XXXXX"
            storeFile file("XXXXX")
            storePassword "XXXXX"
        }

        config {
            storeFile file("XXXXX")
            storePassword "XXXXX"
            keyPassword "XXXXX"
            keyAlias "XXXXX"
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    bundle {
        language {
            enableSplit = false
        }
    }

    buildTypes {

        debug {
            signingConfig signingConfigs.config
            getIsDefault().set(true)
            minifyEnabled false
            debuggable true
            jniDebuggable false
            shrinkResources false
            zipAlignEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', '$playcoreDir/proguard/common.pgcfg', '$playcoreDir/proguard/per-feature-proguard-files'
            manifestPlaceholders = [isEnableCrashReporting: "false"]

        }

        release {
            signingConfig signingConfigs.config
            minifyEnabled true
            shrinkResources true
            zipAlignEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', '$playcoreDir/proguard/common.pgcfg', '$playcoreDir/proguard/per-feature-proguard-files'
            manifestPlaceholders = [isEnableCrashReporting: "true"]

        }

        unitTestVariants.all {
            it.mergedFlavor.manifestPlaceholders += [isEnableCrashReporting: "false"]
        }

        externalNativeBuild {
            ndkBuild {
                path 'src/main/jni/Android.mk'
            }
        }

    }

    flavorDimensions "audience"
    productFlavors {

        appGallery {
            dimension "audience"
            setProperty("archivesBaseName", "XXX")
            signingConfig signingConfigs.appGallery
            buildConfigField "String", "BASE_URL", "\"XXXXX\""
            firebaseAppDistribution {
                releaseNotes = "Version XXXXX"
                serviceCredentialsFile = file(firebaseServiceAcc)
                appId = firebaseAppId
                groups = "XXXX"
                apkPath = "app/build/outputs/apk/appGallery/release/XXX-appGallery-release.apk"
            }
        }


        playStore {
            dimension "audience"
            setProperty("archivesBaseName", "XXX")
            buildConfigField "String", "BASE_URL", "\"XXXXX\""
            signingConfig signingConfigs.playStore
        }

        staging {
            dimension "audience"
            getIsDefault().set(true)
            signingConfig signingConfigs.playStore
            setProperty("archivesBaseName", "XXX")
            versionNameSuffix "-Staging"
            buildConfigField "String", "BASE_URL", "\"XXXX\""
            firebaseAppDistribution {
                releaseNotes = "Development Version\nUrl : XXXXX"
                serviceCredentialsFile = file(firebaseServiceAcc)
                appId = firebaseAppId
                groups = "XXXXX"
                apkPath = "app/build/outputs/apk/staging/release/XXX-staging-release.apk"
            }
        }
    }

    buildFeatures {
        dataBinding true
    }

    testOptions {
        unitTests.includeAndroidResources = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude("META-INF/*.kotlin_module")
    }

}

play {
    serviceAccountCredentials = file(googlePlayServiceAcc)
    track = "beta"
    defaultToAppBundles = true
    resolutionStrategy = "auto"
    releaseStatus = "completed"
    updatePriority = 5
    userFraction = 1.0
}

dependencies {
    // my libs
}

apply plugin: 'com.google.gms.google-services'

so, it'd be nice if anyone helped me to solve this issue

HINT: normal debug run working but, it's taking time to build & run in debug mode

0 Answers
Related