Session 'app' error while installing APK

后端 未结 30 1762
轻奢々
轻奢々 2020-11-28 03:30

I am having difficulty importing a project written on Android Studio 1.1 into Android Studio 2.1.2. I keep getting this error whenever the gradle is building before testing

相关标签:
30条回答
  • 2020-11-28 04:12

    This is a terrible problem, i have facing it so much time, First of all when you run on emulator or real device please make sure that it is not show device is offline in Android monitor, see picture below due to bad cable connection device is showing offline, so make sure first that it is online.

    If it's Okay then clean your project and Rebuild your project. You can do it from Build -> clean project / Build-> Rebuild project

    Still problem occurs then try to Restart android studio. This is generous error happens due to above cases.But i solve it this way as described.

    0 讨论(0)
  • 2020-11-28 04:12

    Try to this way :

    1) In Instance Run is Enable then desable it. 2) Save it and Rebuild the project. 3) Check devices is online or USB debugging On your device. 4) Then Run It App On your devices.

    Note :

    If you use mobile device is MI (Xiaomi) Then Check : => setting>Additional setting> Developer options> Install via USB (ON it) => setting>Additional setting> Developer options> USB debugging (ON it) => setting>Additional setting> Developer options> Verify apps over USB (ON/Off it)

    0 讨论(0)
  • 2020-11-28 04:12

    i was also getting the same error repeatedly but could not solve it as i am complete new to android development. But then it came to my mind that the error is appearing because its not able to install the apk in the device as the error says. So i make sure that my Oneplus3 is in debugging mode and also allowing file transfer when connected via USB. And this solved the problem.

    Also previously it was not doing the instant run but now it does.

    So check whether your android device is allowed to transfer files while connected via USB. This might help.

    0 讨论(0)
  • 2020-11-28 04:13

    Best step to resolve this error is- Uncheck the instant run in File >Settings >Build,Execution,Deployment > Instant Run

    0 讨论(0)
  • 2020-11-28 04:13

    In my case, my project location contained the special character.

    E:\Android_Projects\T&PUIET,KUK\app\build\outputs\apk\app-debug.apk

    close android studio > rename folder containing the special character(here T&PUIET,KUK ) > restart android studio.

    Hope this Solution helps!

    0 讨论(0)
  • 2020-11-28 04:13

    Here is gradle console updates:

    5:01 PM Gradle build finished in 1s 252ms
    
    5:13 PM Executing tasks: [:app:assembleDebug]
    
    5:13 PM Gradle build finished with 15 error(s) in 1s 125ms
    
    5:15 PM Executing tasks: [:app:assembleDebug]
    
    5:15 PM Gradle build finished with 13 error(s) in 1s 608ms
    
    5:16 PM Executing tasks: [:app:assembleDebug]
    
    0 讨论(0)
提交回复
热议问题