|
when i create a assetbundle and put it in the application.data path in iphone manually,then in the code ,i use the www to load the assetbunld, but it just return the error "load assetbundle fail" and the www.assetbundle is null.can anyone help ,thanks. i just use BuildPipeline to create the assetbundle.and the code is ok on windows and mac platform. and i print the www.error msg ,it is "bad URL".but i can download the file from web browser. //the console message as below: //my assetbundle url to load by www file:///Users/ios/Library/Application Support/iPhone Simulator/4.1/Applications/ABF0D1D0-F88B-41BC-883F-601BC0BC50D1/demo3.app/Data/../AssetBundles/CharacterElementDatabase.assetbundle (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/ExportGenerated/iPhoneSimulatorPlayerUnityLib/UnityEngineDebug.cpp Line: 34) (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/ExportGenerated/iPhoneSimulatorPlayerUnityLib/UnityEngineDebug.cpp Line: 34) Failed to load asset bundle (Filename: /Applications/buildAgent/work/842f9557127e852/Runtime/Misc/AssetBundleUtility.cpp Line: 185) bad URL
(comments are locked)
|
|
I found this really helpful, hopefully others looking here will too: http://www.chrisdanielson.com/2011/05/03/unity3d-file-assetbundles-on-the-iphone/ It is possible to get access to files in the XCode project by first getting Asset.DataPath, and traversing the directory one level to files within the root of the xcode project, eg:
(comments are locked)
|
|
Hi, I've a similar problem. This local path seems fine to me. Usually with native iOS you load file with NSURL url = [NSURL urlWithString:@"file://..../Documents/filename"]; On Unity this doesn't works... does anyone knows why?
(comments are locked)
|
|
It looks like the url you are trying to use is a local path on your computer:
This will of course not work on your iPhone.
(comments are locked)
|

I have the same problem:
public static string AssetBundleURL { get { if (Application.platform == RuntimePlatform.WindowsWebPlayer || Application.platform == RuntimePlatform.OSXWebPlayer) { return Application.dataPath + "/assetbundles/"; } else if(Application.platform == RuntimePlatform.IPhonePlayer) { return "file://" + Application.dataPath + "/Raw/assetbundles/"; } else { return "file://" + Application.dataPath + "/../assetbundles/"; } } }
I already checked if the files are in the path
file:///Users/dev/Library/Application Support/iPhone Simulator/5.0/Applications/E01747A0-F487-4415-825B-6095FDCBEE6E/rb.app/Data/Raw/assetbundles/ios.assetbundle
and they are...
But I get the following error:
bad URL