问题
One of my Visual Studio 2015 Cordova projects has recently started exhibiting this error when trying to debug with IOS / Ripple - iPhone (any):
Error DEP10402: Could not locate the start page. You may need to build your project.
Oddly it only occurs in this one project and it works fine with Android / Ripple. I can also deploy and debug to local / remote devices just fine.
I've tried rebuilding of course as well as clearing the Cordova cache as well as rebooting.
Any ideas?
回答1:
Both the above solutions didn't work for me. I did this steps:
1. Locate the start page in config.xml. Usually, it is index.html.
2. Make a copy the index.html and paste it back. The filename is like "index - Copy.html".
3. Delete the original index.html
4. Rename "index - Copy.html" back to index.html
5. Start Debug.
It worked for me.
回答2:
Had the same problem, and the posted solutions didn't solve it for me.
I found that when I changed platforms from Android to iOS and Visual Studio was able to deploy the Cordova project...
So to fix the issue for Android, I did the following:
1. I opened the project folder in Explorer
2. Entered the "platforms" sub-folder
3. Deleted the subfolder "android".
4. Back to Visual Studio => changed platform back to android
5. Rebuild.
Now the android ripple worked for me.
Another thing to try is to create a new solution configuration:
1. Set your project as Startup project
2. Build => Configuration Manager...
3. Choose <New...>
4. Name your config. Don't copy settings.
5. Click OK.
6. Set checkmarks in Build and Deploy for your startup project only.
Choosing the new configuration now allows me to debug in ripple.
Edit: This happens from time to time in my solutions. In addition to the steps above, I have also had to reinstall the platform using the cordova CLI and also (from Visual Studio) removing and adding cordova plugins again. I would advise to try the listed answers until one fixes your problem.
回答3:
I used to get the same error while debugging my Cordova project. Every time I get this, I just follow some simple steps:
- Restart Visual studio and re-open your project,
- Go to Solution Explorer and try to open your project's start page manually,
- Clean and Deploy your solution.
Hopefully, this will work out.
回答4:
I tried various suggestions provided in the above answers, but what worked for me was moving index.html from:
Project_Folder to Project_Folder /src
and in package.json I added:
"main": "src/index.html" as a property(added a version
property as well, as it was complaining about that as well).
I also changed Start page in config.xml to src/index.html as mentioned above.
Hope this helps!
回答5:
Simply remove your platform and re-add it. This worked for me
- open cmd
- goto your project
- type: cordova platform rm android
- after removing, type: cordova platform add android
- then run your project
回答6:
I experienced this error on a new development environment where I loaded the project from git.
Resolved the error by re-adding the file using "Add --> Existing item..." on my start page in Visual Studio. Without actually ever removing the file or anything like that.
After that I got a bunch of 404 errors on project files when running Ripple, tried resolving these the same way as with the start page file, but that did not solve the errors. Eventually got these solved as well by deleting the ".cordova" folder under "%APPDATA%" and then rebuilding the project.
回答7:
There is a lot of answers but It didn't help me. A spent a few hours to resolve this error. What I did:
- remove all build folders (bin, bld, platforms, node_modules);
- copy "index.html" file;
- remove "index.html" file;
- rename Start Page form "index - Copy.html" to "index2.html";
- rebuild the proj.
And it works.
回答8:
The same error happened to me, after I had renamed my index.html as index-old.html and moved it to another folder. Somehow the build script couldn't "see" the new index.html file.
So I was just committing everything to subversion to make sure that I had back-up, preparing to rebuild my project completely, when I noticed that index.html wasn't in the www folder any more (despite the fact I had it open in Visual Studio!)
So I saved it to the www folder and then it rebuilt fine.
Long story short: check that the file actually exists in the folder you think it exists in!
回答9:
I had to go into the index.html directory and run npm install
回答10:
For me it was that the www folder was empty, so it could not find index.html. www wasn't it wasn't being built to.
Deleting this folder first: %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache
Then renaming the index.html file using @asanga15 copy command worked.
See this similar issue here: No files showing in a Visual Studio 2015 Blank Cordova project
回答11:
In my case,the same problem happened because my project name was "some.app",so the name in config.xml was "some.app" too.
After I removed the dot in the name(from "some.app" to "someapp"),it worked.
(Just changed the name in the config.xml file,my project name still has a dot)
- VS 2015 Update 3
- Cordova CLI 6.3.1
- Ionic 2 RC4 (Angular2 2.2.1)
回答12:
First I had the same error: Error DEP10402: Could not locate the start page. You may need to build your project.
I had to update the package.json (angular version to 2.0.0-rc.5 and some other dependencies). Take a look at the ionic changelog in github: https://github.com/driftyco/ionic/blob/master/CHANGELOG.md
There u can see a working package.json. Just update the version numbers and missing dependenciesu are using right now and your project will be build as well =)
There is also a note, that there has been issues with the last version: Note: please ensure you are using the exact TypeScript and Angular versions listed above. There have been issues with the latest versions.
回答13:
had the error in the ionic 2 template in visual stuidio 2015 i changed it to src/index.html in the config.xml and it works fine :)
回答14:
It worked after uninstalling ionic
from the project folder
npm uninstall -g ionic
npm install -g ionic
Then build using ionic build android.
And then run from VS 2015.
It works :)
回答15:
VS has nodejs in web\external tools dir, which is older version than the one you would see on nodejs.org.
Solution:
- fix the versions for your dependencies in package.json, and make sure you are using app-scripts 1.0.0 in your devDependencies
- instead of using node/npm from VSINSTALLDIR/web/external I'm using global installation of node and npm, to do that go to external tools configuration in VS, and remove the entries from there, just keep $PATH, I assume you have global installation of GIT, so you can remove it too.
Check out my another answer here
回答16:
Simply I changed the name of starting page form index.html to index2.html and changed it into file config and it works.
回答17:
I think your Cordova version is higher than 6.3.1, the highest version supported by Visual Studio, so you must build your app via CLI (cordova run browser).
来源:https://stackoverflow.com/questions/36631133/error-dep10402-could-not-locate-the-start-page-you-may-need-to-build-your-proj