Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 WinterboltGames · Jan 27, 2018 at 10:16 AM · il2cppsave-to-filewrite data

Unable to write files to storage [SD or Internal] when building with IL2CPP in unity 2018.1.0b4

When I build with IL2CPP in unity 2018.1.0b4 and try to write a file to the storage nothing happens! here's my code...

 using UnityEngine;
 using System.IO;
 using Newtonsoft.Json;
 
 public class Serializer : MonoBehaviour
 {
     public void Serialize ()
     {
         string json = JsonConvert.SerializeObject(saveData, Formatting.Indented);
 
         File.WriteAllText(Path.Combine(Application.persistentDataPath, "savegameData.json"), json);
     }
 }
Comment
Add comment · Show 1
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 Bunny83 · Jan 27, 2018 at 12:06 PM 0
Share

Are you sure that your app has the right permissions set? I haven't used IL2CPP with Android yet. I guess you talk about Android? If not you may want to edit your question and clarify. Unity usually detects automatically which permissions are needed based on what classes / methods are used. It's possible that this doesn't work / doesn't work quite right. Though internal storage access doesn't require any permissions and should always work. Have you tried showing the content of your persistentDataPath on screen for debugging purposes.


$$anonymous$$eep in $$anonymous$$d that beta releases are not ment to be used in production as they may contain experimental stuff and may contain bugs, hence it's a beta version.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dediub · Nov 25, 2018 at 10:54 PM

The same to me man. AND NOBODY HELPS!, there is nothing out there that can help us. I have done all that they say and it never Works. I have almost the same code. I had tried with persistentDataPath, Environment.Personal, dataPath with the same behaviour: EDITOR WORKS AND THE BUILD NOT.

Good work UNITY, I have never seen such error like this, NEVER!.

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 dediub · Nov 25, 2018 at 11:26 PM 0
Share

I have the solution man!!!, try to watch your file: User\AppData\LocalLow\Company Name\Game name\output_log.txt Here you will find the exception that ruins your game. $$anonymous$$y error was one Json$$anonymous$$apper exception. FIXED!! LUC$$anonymous$$

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

76 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 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 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 avatar image

Related Questions

Write Webcam Capture Tp Specific Folder 1 Answer

How to save&load every Transform data of a child of a GameObject? 0 Answers

How to create and save Prefabs on device. 1 Answer

Is there a way to save the player data (i.e. position) every 1 second automatically while he is playing? 1 Answer

Write data on disk and keep after unisntall(Android) 0 Answers


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