Has anyone been able to get the lastest android update (7.0.0) to work with visual studio?
VS says the build is successful, but when you try to deploy, the step fails because it cannot find the created output.
I THINK it may be a matter of updating some of the paths, but figured I'd see if anyone has already figured it out.
Given that taco.visualstudio.com hasn't seen an update since June 2017, I'm wondering if the project isn't dead :-(
1>------ Build started: Project: myProject, Configuration: Debug Android ------
Cordova 7.1.0
------ Platform android already exists
------ Copying native files from D:\myproject\res\native\android to D:\myproject\platforms\android
------ Done copying native files to D:\myproject\platforms\android
2>------ Deploy started: Project: myProject, Configuration: Debug Android ------
2>Could not locate the start page. You may need to build your project.
2>Deployment failed.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
EDIT: Backing down to Android@6.4.0 has resolved my immediate problem. But it is not a long term solution.
A bit hacky, but here's what I got to work.
Got a clue from: https://developercommunity.visualstudio.com/content/problem/199609/cordova-ios-640-deployment-error-due-to-change-bui.html (although suggested path did not work for me)
I've only been looking at Android so far, so I will talk in terms of that. The cordova android platform 6.4+ puts the built apk here:
[project]\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Visual Studio seems to be looking for it here:
[project]\platforms\android\build\outputs\apk\app-debug.apk
I added an "after_build" hook that copies the app-debug.apk and output.json files to the folder VS is looking in. I had to manually add the folder structures (for both the location of files being copied and location of hook file). I just added the following file, and the build process picks it up automatically.
[project]\hooks\after_build\copy_android_apk.js
contents of copy_android_apk.js:
#!/usr/bin/env node
console.log(" -- manual step -- have to copy apk to this folder because that is where VS is looking for it...");
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
var srcfile = path.join(rootdir, "platforms\\android\\app\\build\\outputs\\apk\\debug\\app-debug.apk");
var destfile = path.join(rootdir, "platforms\\android\\build\\outputs\\apk\\app-debug.apk");
var destdir = path.dirname(destfile);
if(fs.existsSync(srcfile) && fs.existsSync(destdir)) {
fs.createReadStream(srcfile).pipe(
fs.createWriteStream(destfile));
}
srcfile = path.join(rootdir, "platforms\\android\\app\\build\\outputs\\apk\\debug\\output.json");
destfile = path.join(rootdir, "platforms\\android\\build\\outputs\\apk\\output.json");
destdir = path.dirname(destfile);
if(fs.existsSync(srcfile) && fs.existsSync(destdir)) {
fs.createReadStream(srcfile).pipe(
fs.createWriteStream(destfile));
}