Xcode Not Loading Javascript?

BASIC SDK для Xcode
Post Reply
the_wesley_watkins
Posts: 42
Joined: Wed Jul 29, 2015 3:53 pm
My devices: Ipad
Iphone

Xcode Not Loading Javascript?

Post by the_wesley_watkins » Wed Aug 16, 2017 10:29 pm

I want to start by apologizing for asking so many questions recently. This is my first time uploading an app to the App Store and it has been quite tedious.

Anyways, for some reason, Xcode will not load my javascript files. My file setup under Samples is similar to this:

main.txt
lib
-> index.html
-> index.js
-> index.css


My main.txt file is:

Code: Select all

SET ORIENTATION PORTRAIT
SET TOOLBAR OFF
GET SCREEN SIZE maxx,maxy

BROWSER "main" URL "lib/index.html" AT 0,0 SIZE maxx,maxy

menu:
SLOWDOWN
goto menu

I have my phone hooked up to my Mac and I am running the app on my iPhone. The first time I ran it, everything worked fine. I fixed a few typos, ran the code again, and now it is like my "index.js" file is not loading. The html loads up, the css styling works, but none of the javascript is working. I put an alert("test") at the top of my javascript file and it did not work.

However, when I put <script>alert("hi");</script> in my HTML file, it does work.

So, if I type the javascript into my HTML using <script> tags, it works. But for some reason, I cannot load external JS files.

Also, I need to mention, if I run my index.html file in a Browser such as Safari or Google Chrome, everything works fine. It is only when I try to run the code on Xcode that it does not work.

the_wesley_watkins
Posts: 42
Joined: Wed Jul 29, 2015 3:53 pm
My devices: Ipad
Iphone

Re: Xcode Not Loading Javascript?

Post by the_wesley_watkins » Wed Aug 16, 2017 10:32 pm

Also, I don't know if this will be of any help, but here is what pops up in the console once I run the project:


2017-08-16 17:31:15.023562-0500 Perfect 36[308:14505] libMobileGestalt MobileGestaltSupport.m:153: pid 308 (Perfect 36) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-08-16 17:31:15.024762-0500 Perfect 36[308:14505] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
2017-08-16 17:31:15.645724-0500 Perfect 36[308:14566] 0x17415cbf0 Copy matching assets reply: XPC_TYPE_DICTIONARY <dictionary: 0x17415cbf0> { count = 3, transaction: 0, voucher = 0x0, contents =
"Assets" => <data: 0x174268800>: { length = 1229 bytes, contents = 0x62706c6973743030d4010203040506646558247665727369... }
"Result" => <int64: 0x174032d20>: 0
"AssetXMLMetadata" => <data: 0x174268080>: { length = 307 bytes, contents = 0x62706c6973743030d40102030405061f2058247665727369... }
}
2017-08-16 17:31:15.648839-0500 Perfect 36[308:14566] 0x17415e400 Copy assets attributes reply: XPC_TYPE_DICTIONARY <dictionary: 0x17415e400> { count = 1, transaction: 0, voucher = 0x0, contents =
"Result" => <int64: 0x174032d60>: 1
}
2017-08-16 17:31:15.648960-0500 Perfect 36[308:14566] [MobileAssetError:1] Unable to copy asset attributes
2017-08-16 17:31:15.649543-0500 Perfect 36[308:14566] Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes" UserInfo={NSDescription=Unable to copy asset attributes}
2017-08-16 17:31:15.652591-0500 Perfect 36[308:14566] 0x17415ec40 Copy matching assets reply: XPC_TYPE_DICTIONARY <dictionary: 0x17415ec40> { count = 3, transaction: 0, voucher = 0x0, contents =
"Assets" => <data: 0x174268f80>: { length = 1237 bytes, contents = 0x62706c6973743030d4010203040506636458247665727369... }
"Result" => <int64: 0x174032b40>: 0
"AssetXMLMetadata" => <data: 0x17426b000>: { length = 307 bytes, contents = 0x62706c6973743030d40102030405061f2058247665727369... }
}
2017-08-16 17:31:15.654820-0500 Perfect 36[308:14566] 0x170356580 Copy assets attributes reply: XPC_TYPE_DICTIONARY <dictionary: 0x170356580> { count = 1, transaction: 0, voucher = 0x0, contents =
"Result" => <int64: 0x17003a100>: 1
}
2017-08-16 17:31:15.654885-0500 Perfect 36[308:14566] [MobileAssetError:1] Unable to copy asset attributes
2017-08-16 17:31:15.654997-0500 Perfect 36[308:14566] Could not get attribute 'LocalURL': Error Domain=MobileAssetError Code=1 "Unable to copy asset attributes" UserInfo={NSDescription=Unable to copy asset attributes}

User avatar
Mr. Kibernetik
Site Admin
Posts: 4605
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPad, iPhone, MacBook
Location: Russia
Flag: Russia

Re: Xcode Not Loading Javascript?

Post by Mr. Kibernetik » Wed Aug 16, 2017 10:40 pm

Xcode should not load any files. It just runs your BASIC program, nothing more. It is your BASIC program which loads other files.
If your BASIC program runs on your device then just copy all your program files to SDK as it is described in tutorial - and it will run in Xcode exactly the same way as it runs on your device.

If you change something in your program then clear the project - this operation deletes old cached files.

the_wesley_watkins
Posts: 42
Joined: Wed Jul 29, 2015 3:53 pm
My devices: Ipad
Iphone

Re: Xcode Not Loading Javascript?

Post by the_wesley_watkins » Wed Aug 16, 2017 10:41 pm

Nevermind! I found the error. For some reason, Xcode renames certain files to all lowercase... weird...

Post Reply