开发者

PhoneGap application: "ERROR: Start Page at `www/index.html` was not found"

开发者 https://www.devze.com 2023-03-06 21:02 出处:网络
I have created a Phone Gap based application on iPhone. After the first run, I have dragged my www folder, containing index.html into the project, but still I am getting the following error in the sim

I have created a Phone Gap based application on iPhone. After the first run, I have dragged my www folder, containing index.html into the project, but still I am getting the following error in the simulator:

ERROR: Start Page at www/index.html was not found.

Do I have to mention the name of index.html in a plist file or anywhere else? How can I resolve this; can any开发者_运维技巧 one help me?


It's an incompatibility between PhoneGap and XCode 4. To resolve:

  • right click on your project and choose "Add files to [project name]...";
  • choose the www folder from your curent project's folder (it's included in there, but not added as a reference);
  • when you select the folder, make sure you choose "Copy items into destination group's folder" as well as "Create folder references for any added folders".

Note: if you choose "Create groups for any added folders", the app will still fail at runtime.


For those who are as silly as me... I had forgotten to run cordova build.


Quit XCode and apply below command in terminal, its work for me

ionic cordova prepare ios


Try removing the reference, and adding it again. Did you add it as a "Reference"? The icon should be in blue. Then clean and rebuild.


I had the same problem where it worked in the simulator but not a device. My issue was case sensitivity. My file was Index.html instead of lower case index.html.


You could also just drop the www folder w/Finder into the Xcode Nav tab (root), after that just check dialog checkboxes "Copy items into destination group's folder" and "Create folder references for any added folders".


What versions of Xcode and PhoneGap are you using?

If you're using the older Xcode 3 and are creating a new project using the PhoneGap template... it should automatically create a www folder for you, along with a generic index.html file. If you've dragged your folder and index file into the project, then you should have been overwriting the existing files.

If you're using Xcode 4, there's a known issue with getting a PhoneGap project set up. It would be helpful to know what tutorial/guide you are following (assuming you are using a guide).

In very random cases, changes you make to your files/folders directly (via Finder) might not be picked up immediately by Xcode. You could always try quitting out of Xcode and re-opening your project, to ensure Xcode is pulling the latest files.


Well cordova build ios android was the only thing that worked for me, and cordova build didn't cut it.


in xcode target - Copy Bundle Resource add www folder


You can fix this issue by adding www to Targets > Build Phases > Copy Bundle Resources

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号