Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

iOS error: "Setup: loading style failed: no such file or directory" #852

Merged
merged 1 commit into from
Mar 4, 2015

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented Mar 4, 2015

I cloned the latest version of the repository (including submodules), ran package_ios.sh without errors, and added Headers/, MapboxGL.bundle and libMapboxGL.a to the appropriate build phases.

The build compiles, but complains on startup that "loading style failed".

screenshot-mapbox

This issue has been discussed before for Android (#585, #719). Looking through the source, it seems that the library is looking for styles in "asset://styles/styles/". From the previous discussion, I'm not sure where asset:// is on iOS (maybe MapboxGL.bundle? I confirm MapboxGL.bundle contains the styles/ directory).

How can this be fixed?

@ljbade ljbade added iOS Mapbox Maps SDK for iOS build labels Feb 11, 2015
@mb12
Copy link

mb12 commented Feb 11, 2015

Here is the relative path for default style.json file.

mapbox-gl-native/styles/styles/bright-v6.json

If you do not have the styles submodule, do the following in your mapbox-gl-native directory.

git submodule init
git submodule update

@onato onato mentioned this pull request Feb 11, 2015
@DavidChouinard
Copy link
Author

Yes, I have all submodules and styles/styles/* exists in the mapbox-gl-native directory. The build runs without errors and correctly recognizes styles/styles/*. (removing the directory causes a build error)

The library fails when calling useBundledStyleNamed(). A similar issue was independently reported a few hours later by another user (#856).

@thomas-huet
Copy link

I also have the same problem on android.

@incanus
Copy link
Contributor

incanus commented Feb 11, 2015

Ok, will take a look at this. Lots of recent shuffling and using the bundled styles needs some attention, it seems.

@incanus incanus removed the iOS Mapbox Maps SDK for iOS label Feb 11, 2015
@incanus incanus modified the milestone: iOS Beta Feb 13, 2015
kkaefer added a commit that referenced this pull request Mar 4, 2015
iOS error: "Setup: loading style failed: no such file or directory"
@kkaefer kkaefer merged commit e07e980 into master Mar 4, 2015
@kkaefer kkaefer deleted the checkout-styles-submodule branch March 4, 2015 17:13
@robipresotto
Copy link

still the same problem after set the bundledStyle to
[self.mapView useBundledStyleNamed:@"outdoors-v7"];

by robitto 2015-03-05 at 17 56 16 2

@incanus
Copy link
Contributor

incanus commented Mar 5, 2015

Please make sure your Git submodule are initialized @robipresotto.

@robipresotto
Copy link

I'm running: make clean > make distclean | init submodule init > init submodule sync > init submodule update and ./scripts/package_ios.sh -> after build the package I replace my current package and nothing changes (i see the styles on bundle but the system not recognise it)
by robitto 2015-03-05 at 18 20 26

@robipresotto
Copy link

MacBook-Pro:mapbox-gl-native robipresotto$ git submodule status
03869fd11e4bc619d3ba7e4f8a1f00d4612c90ea .mason (03869fd)
25b1b7dff37a18151e3286144bc8013b432a8860 styles (25b1b7d)
ab5a46ff7e970de5578df48a1e1f013bd5e1bd4e test/ios/KIF (v3.0.8-1-gab5a46f)
6ac15153826ab26f778d61034119ffa8f97566ac test/suite (6ac1515)

@DavidChouinard
Copy link
Author

This issue still exists.

It seems the commit only dealt with making sure the Git styles submodule was included. That wasn't the original issue: the styles/ directory is included, but the system crashes with loading style failed: no such file or directory.

@1ec5
Copy link
Contributor

1ec5 commented Mar 16, 2015

I also ran into this issue while looking into #829. The bundled demo app gets away with copying styles/ itself directly into the main bundle directory, rather than under an intermediate MapboxGL.bundle.

Over to #1011 since this is a merged PR.

@DavidChouinard
Copy link
Author

Thank you. I'm not sure how related this is, but I now get a SIGABRT crash. (I've isolated the issue to the useBundledStyleNamed() invocation)

screen shot 2015-03-16 at 8 04 26 pm

@1ec5
Copy link
Contributor

1ec5 commented Mar 17, 2015

I filed #1014 for that crash. It isn’t related to the bundle path, although with #1011 fixed, the default style can load without running into the crash.

@DavidChouinard
Copy link
Author

Thank you for looking into this.

(I get a black screen when not specifying a style)

img_4222

@1ec5
Copy link
Contributor

1ec5 commented Mar 17, 2015

@DavidChouinard Even if you incorporate #1012? I’m seeing bright-v7 load by default.

Let’s continue the discussion in #1011, since this PR was for a very different issue.

@1ec5
Copy link
Contributor

1ec5 commented Mar 18, 2015

@DavidChouinard even with #1012, it’s going to be black unless you pass either a JSON stylesheet or a Mapbox access token. You need a token to get the default Bright style.

@DavidChouinard
Copy link
Author

@1ec5 Sorry for the delayed response. I rebuilt the latest version and things now work as expected.

Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants