Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Bonobo · May 21, 2014 at 04:49 PM · iosfile

iOS build cannot open files in Data folder

In iOS builds, sometimes Unity cannot open files in the Data folder. The problem is inconsistent, sometimes it is able to open a file but later the same file cannot open. Also, it works correctly in the editor and Standalone-Mac builds.

Sometimes it fails to open an asset file, when this happens there are missing textures or prefabs fail to instantiate. The XCode log might look like this:

Could not open file /var/mobile/Applications/E52F70F0-C857-4583-9C77-F8A0E50A5D21/XXX.app/Data/sharedassets40.assets for read

Sometimes if fails to open a level file, when this happens the app freezes. The XCode log is:

Could not open file /var/mobile/Applications/E52F70F0-C857-4583-9C77-F8A0E50A5D21/XXX.app/Data/level39 for read

The files do exist when I look for them manually in the build folder. Furthermore, the fact that the app sometimes loads assets/scenes correctly suggests that it is able to find the Data folder.

(Edit: After using the filebrowser posted by Graham, I can confirm that the files were copied to the iOS device. The files that could not open were all logged, even after the error occured.)

Sometimes a file opens normally a few times before the same file is unable to open.

Has anyone encountered a similar problem?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bonobo · May 22, 2014 at 10:49 AM 0
Share

Thanks Graham.

I have used the filebrowser, and modified so that ProcessFolder is called after the error occurs.

All of the files were copied to the iPad. Even after a file "could not open", the file is still logged by the filebrowser.

avatar image kunkun2 · Jun 11, 2015 at 09:22 AM 0
Share

i got the same problem! my unity's version is 4.6.3p3.

here is the log infos:

"Could not open file /private/var/mobile/Containers/Bundle/Application/52DA9160-D640-4472-9466-FAA3C49D589F/demo.app/Data/resources.assets for read"

and it looks like what Bonobo said: "sometimes it is able to open a file but later the same file cannot open."

anyone know the reason?

avatar image always_beta · Jul 08, 2015 at 02:25 AM 0
Share

$$anonymous$$aybe because of too many open files in iOS (iOS has limitation for maximum open file)?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Graham-Dunnett · May 21, 2014 at 08:54 PM

Never heard that problem before. If the files exist in the Data folder in the Xcode project, then it's possible these files haven't been correctly copied over to the iOS device when Xcode deploys the app. It's probably worth dumping out the contents of the Data folder:

 using UnityEngine;
 using System;
 using System.IO;
 
 public class filebrowser : MonoBehaviour {
 
     void ProcessFolder(string f) {
 
         Debug.Log("Folder: " + f);
             
         var txtFiles = Directory.GetFiles(f);
         foreach (string currentFile in txtFiles) {
             Debug.Log("File: " + currentFile);
         }
 
         string[] subs = Directory.GetDirectories(f);
         foreach(string sub in subs)
             ProcessFolder(sub);
             
     }
     
     // Use this for initialization
     void Start () {
         ProcessFolder(Application.dataPath);
     }
     
     // Update is called once per frame
     void Update () {
     
     }
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vkajudiya · Feb 15, 2016 at 09:39 PM 0
Share

hi . Graham Dunnett

i am haveing Same issue . i have LevelData.Bin file stored at Asset root . when i build for ios and try to locat using Application.datapath i cant not found it on device.

and from path "E52F70F0-C857-4583-9C77-F8A0E50A5D21" this id is Differnt At every time i run project on device.

i checked all files from path but not getting level data.bin file . is there any way to conform unity include this file in xcode build ?

i also Check this Script and Check log but i dont get this Data.bin file which i create threw unity editor. now how to include this file in Xcode ?

avatar image
0

Answer by Bonobo · Feb 23, 2016 at 09:57 AM

A few other people have had the same problem. We eventually fixed the issue, but didn't have the time to get at the root cause of why the problem was occuring, so I can't explain it precisely.

We had an "Audio Manager" GameObject. The object had lots of children, each child had audio management scripts and each script referenced different audio files. When we added too many children to the GameObject then the problem started to occur. I suspect that if you are having this issue and it still hasn't been fixed in Unity then you have too many file references in your scene.

@vkajudiya @kunkun2

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

25 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A Blank IOS Project That I Build Is Massive At 300MB 0 Answers

Trouble getting Google GVRVideoPlayer to Implement in Unity 5.6.2 with Google Cardboard v1.60 0 Answers

How to save files into Downloads folder on iOS? 0 Answers

Load and save file. IOS problem 0 Answers

How to save textures to iOS devices, ask for help. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges