Error DEP10402: Could not locate the start page. You may need to build your project

14,662

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

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

Solution 3

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!

Solution 4

I used to get the same error while debugging my Cordova project. Every time I get this, I just follow some simple steps:

  1. Restart Visual studio and re-open your project,
  2. Go to Solution Explorer and try to open your project's start page manually,
  3. Clean and Deploy your solution.

Hopefully, this will work out.

Solution 5

Simply remove your platform and re-add it. This worked for me

  1. open cmd
  2. goto your project
  3. type: cordova platform rm android
  4. after removing, type: cordova platform add android
  5. then run your project
Share:
14,662
Corey Roth
Author by

Corey Roth

Corey Roth is a SharePoint Consultant in Tulsa, OK.

Updated on June 14, 2022

Comments

  • Corey Roth
    Corey Roth about 2 years

    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?