简体   繁体   中英

Visual Studio 2015 Cordova error: Could not locate a deployable apk

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.

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

看这里

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

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

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

如何尝试清除Project root中的解决方案并重新生成。

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.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM