You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
@incanus encountered this error while testing the app: 11-10 13:33:42.691 4742-4776/com.mapbox.mapboxgl.app E/Setup﹕ loading style failed: 404 (no such file or directory)
He got around it by changing setStyleURL to a https source.
However I have not seen this error myself before.
@incanus Could you please add more detail about what you did to get this error?
e.g. was it Android 4 or 5, was it the emulator or your Nexus 7, how did you install/run the app etc.
Any other relevant log messages? (perhaps copy whole log into a gist)
I am going to see if I can recreate it by deleting the app's data folder.
Hrm making a list of all the different dirs you can write files too:
Context.getCacheDir - Returns the absolute path to the application specific cache directory on the filesystem. These files will be ones that get deleted first when the device runs low on storage. There is no guarantee when these files will be deleted.
getCodeCacheDir - Returns the absolute path to the application specific cache directory on the filesystem designed for storing cached code. The system will delete any files stored in this location both when your specific application is upgraded, and when the entire platform is upgraded.
getDir - Retrieve, creating if needed, a new directory in which the application can place its own custom data files. You can use the returned File object to create and access files in this directory. Note that files created through a File object will only be accessible by your own application; you can only set the mode of the entire directory, not of individual files.
getExternalCacheDir/s - Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Environment.getExternalStorageDirectory() where the application can place cache files it owns. These files are internal to the application, and not typically visible to the user as media.
getExternalFilesDir/s - Returns the absolute path to the directory on the primary external filesystem (that is somewhere on Environment.getExternalStorageDirectory()) where the application can place persistent files it owns. These files are internal to the applications, and not typically visible to the user as media.
getExternalMediaDirs - Returns absolute paths to application-specific directories on all external storage devices where the application can place media files. These files are scanned and made available to other apps through MediaStore.
getFilesDir - Returns the absolute path to the directory on the filesystem where files created with openFileOutput(String, int) are stored.
getNoBackupFilesDir - Returns the absolute path to the directory on the filesystem similar to getFilesDir(). The difference is that files placed under this directory will be excluded from automatic backup to remote storage. See BackupAgent for a full discussion of the automatic backup mechanism in Android.
getObbDir/s - Return the primary external storage directory where this application's OBB files (if there are any) can be found. Note if the application does not have any OBB files, this directory may not exist.
Ah, sorry about that — that was it exactly. And this just bit me on iOS the other day. I forgot I had checked out this copy previously and barring any sort of error message this was tricky to remember.
Eh, I would avoid automatically pulling submodules. Just feels weird to me. TBH we can probably just leave this and if/when people get the error from not having pulled down the styles, tell them to follow the directions properly (myself included).
Activity
ljbade commentedon Nov 11, 2014
I have not been able to reproduce the problem on my HTC One (M7) or Nexus 7 (2012)
I have tried both uninstalling the app then reinstalling it, was well as just using the Android app settings menu to clear the cache and data folders.
ljbade commentedon Nov 11, 2014
I am having problems getting the emulator to run - I think my laptop is running out of memory.
In the mean time I am going to switch styles and ca-bundle to the data dir instead of the cache dir.
I am also adding logging messages to Assetbridge to see if it highlight any problems.
ljbade commentedon Nov 11, 2014
Found Context.getPackageCodePath that may allow the C++ code to read styles directly from the APK zip file if we include C++ zip library.
ljbade commentedon Nov 11, 2014
Hrm making a list of all the different dirs you can write files too:
ljbade commentedon Nov 11, 2014
It would appear that getCodeCacheDir is the best candidate.
EDIT: argh, it is only on Android 5+
I will use getNoBackupFilesDir instead.
EDIT 2: So is that. Well getFilesDir it is.
ljbade commentedon Nov 11, 2014
OK so Asset bridge extracts some random stuff:
ljbade commentedon Nov 11, 2014
OK I think I may have fixed this in de1f37f.
@incanus Can you test if the problem has been fixed?
incanus commentedon Nov 12, 2014
Nope, I am still seeing this on my
4.4.4Nexus 7.ljbade commentedon Nov 12, 2014
@incanus have you loaded the styles submodule? it appears it is not copying the contents of the styles folder correctly to the android assets folder
incanus commentedon Nov 12, 2014
Ah, sorry about that — that was it exactly. And this just bit me on iOS the other day. I forgot I had checked out this copy previously and barring any sort of error message this was tricky to remember.
ljbade commentedon Nov 13, 2014
@incanus I added a command that will error when the styles files are missing: 14714a1
incanus commentedon Nov 14, 2014
The
Makefilething is breaking for me, including with the fix commit 990be67. Reverting for now & don't have time to fix.ljbade commentedon Nov 14, 2014
Hrm will need to think of another way of detecting missing styles
incanus commentedon Nov 14, 2014
Isn't the real issue that the submodule wouldn't be cloned? Can't we just detect that (i.e. in top-level
./styles)?ljbade commentedon Nov 14, 2014
Ah yes, that will work
ljbade commentedon Nov 14, 2014
Just check for files in ./styles?
ljbade commentedon Nov 14, 2014
I added a git submodules init and update to make android.
Do you think that will work?
incanus commentedon Nov 14, 2014
Eh, I would avoid automatically pulling submodules. Just feels weird to me. TBH we can probably just leave this and if/when people get the error from not having pulled down the styles, tell them to follow the directions properly (myself included).
ljbade commentedon Nov 15, 2014
Well OK then. reverting.