7

I use Visual Studio 2015 to create Cordova project, but when I debug the solution, the VS told me:

Error DEP10402: Could not locate a deployable apk. You may need to build your project.

and I couldn't get any project apk.

3
  • The vs show “ Could not locate the Android Debug Bridge(adb.exe)”
    – Kimi
    Commented Nov 12, 2015 at 9:38
  • I've read a bunch of angry comments on one of the MSDN blog posts about this issue and more after the most recent update: blogs.msdn.microsoft.com/visualstudio/2015/10/06/… Commented Feb 17, 2016 at 18:06
  • I've had a WP8 app completed just fine, but decided to update it and now am facing this issue. Commented Feb 17, 2016 at 18:07

7 Answers 7

10

Use Cordova CLI version 5.4.1 in config.xml platform tab.

look here

5
  • 4
    Why? You give no reason whatsoever. Its fine if this is a solution, but to just blindly say "change this" and then not even give a sentence explaining why isn't excellent. Commented Feb 17, 2016 at 17:51
  • 1
    That's not really a solution. The problem is that Cordova CLI at some point changed the output build folder, not being the one Tools for Apache Cordova uses. Visual Studio then can't find the package to be debugged. Commented Apr 26, 2018 at 14:26
  • @melancia I have the same problem with ionic 3 cordova 8 on vs 2017. I see that the apk was build and is inside a debug folder but vs mentions that it can't locate it. Any ideas where I can set the output build folder?
    – Hamburml
    Commented May 3, 2018 at 10:24
  • @Hamburml I couldn't find a way to change the folder where VS looks for the generated apk for debugging. By default it looks into \bin\Debug, but the current Cordova CLI sticks it into platforms\android\app\build\outputs\apk\debug Commented May 4, 2018 at 15:17
  • 1
    @melancia I was able to create a working ionic 3 vs 2017 template. I added a after-build hook which copies the apk from the folder you mentioned to \bin\debug. github.com/hamburml/ionic3-vs2017-blank-template
    – Hamburml
    Commented May 4, 2018 at 19:29
2

This Error may occurred because of the incompatibility of cordova version, check your installed cordova version bye entrig following

cordova -v

and make sure same version added to visual studio project, in config.xml -> platform -> cordova cli

2

I had the same issue with Visual Studio 2017 and Ionic 3. The cordova-cli 8 (if you use a global cordova-cli) copies the apk into another folder and hence VS doesn't find it. I added a copyapk script which is run after the build is completed.

https://github.com/hamburml/ionic3-vs2017-blank-template

2
  • What are those locations? The template in Github still has this issue. I can see your "copyapk" in package.json "-vs-binding" but not sure what it links/points to. Still getting the error & deployment fails, though. Commented Aug 15, 2018 at 20:33
  • You can find the locations here github.com/hamburml/ionic3-vs2017-blank-template/blob/master/… If you build it for debug, the release apk is missing and an error is present. But the apk should be inside the platforms\android\app\build\outputs\apk\debug\app-debug.apk and must be inside bin\android\debug
    – Hamburml
    Commented Aug 16, 2018 at 8:19
1

it happened before with some versions of cordova-cli

try using 5.4.1 or 5.3.0

i experience this problem in 5.4.0 but it dose not appeared in 5.4.1

it seems that some cordova-cli versions did not use --release as it should be

0

How about try to clear solution from Project root and rebuild again.

1
  • when i met trouble, I have to close all the project and clear cordova cache.
    – Kimi
    Commented Nov 19, 2015 at 8:54
0

Although it's an old question, in my case the problem was caused because of configuration name.

In my project I have several configuration names for different environments (local, dev, pro), when using one of this names, the problem occurs.

If configuration name is set to default "Debug" the error disappears, but then I lose easy environment configuration.

-1

I had the issue and I finally manage to run my application after restarting my machine and avoiding to open any application. It looks like the problem does not arise when there's a lot of available memory...

1
  • My VM in total has 32 GB out of which 17 GB is still available. I'm still getting this error. Commented Aug 15, 2018 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.