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
1
Question by JIrwin · Apr 13, 2014 at 02:20 AM · ioscrashiphonecrashreport

ArgumentOutOfRangeException when calling CrashReport.reports

Using C# to read the Unity CrashReport.reports array, it will throw the following exception/stack when running on an iOS device:

 ArgumentOutOfRangeException: Argument is out of range.
 System.DateTime.AddTicks (Int64 value)
 System.DateTime.AddMilliseconds (Double value)
 System.DateTime.AddSeconds (Double value)
 UnityEngine.CrashReport.PopulateReports ()
 UnityEngine.CrashReport.get_reports ()

I'm using a nearly identical call as documented here: http://docs.unity3d.com/Documentation/ScriptReference/CrashReport.html

This is the line of code failing:

 var reports = CrashReport.reports;


In the CrashReporter.h, I have the following:

 #define ENABLE_IOS_CRASH_REPORTING 1
 #define ENABLE_CUSTOM_CRASH_REPORTER 1
 #define ENABLE_CRASH_REPORT_SUBMISSION 0

In case it's relevant, my Player Settings have:

 Script Call Optimization is "Slow and Safe"

I'm using Unity 4.3.4f1 on a trial Pro License. I'm building to iOS with default settings and compiling with Xcode 5.1 (5B130a). My iOS device is an iPhone 5 (MD644LL/A) running iOS 7.1 (11D167).

Any assistance is appreciated! Thanks :D

Update #1:

As requested, here is my exact code where I call into CrashReport.reports.

To clarify, the exception is thrown when I call "CrashReport.reports"- not when I attempt to iterate on the return value. The ArgumentOutOfRangeException stack above indicates the crash is within the Unity framework, not my script.

 void OnGUI() {
     GUILayout.Label(labelText);
     GUILayout.Label("Crash reports:");

     // this call is crashing with ArgumentOutOfRangeException
     va reports = CrashReport.reports; 
 
     if (reports == null)
         return;
 
     foreach (var r in reports) {
 
         GUILayout.BeginHorizontal();
         GUILayout.Label("Crash: " + r.time);
         if (GUILayout.Button("Log")) {
             Debug.Log(r.text);
         }
         if (GUILayout.Button("Remove")) {
             r.Remove();
         }
         GUILayout.EndHorizontal();
 
         var report = CreateReport(r.text, r.text);
         SendReportToServer(report);
     }
 }

Also, perchik (thanks!) mentioned it could be license related. The docs say:

CrashReport API requires Unity Pro license for target platform.

This may very well be related, as I'm only using a trail version of Unity Pro without the iOS Pro Addon. I'll update as soon as I can verify this is the case or not. Either way, it's a strange way to abort the call if not licensed for it :)

Comment
Add comment · Show 5
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 JIrwin · Apr 14, 2014 at 05:08 PM 0
Share

Is this not a good question? Am I missing some critical information for assistance? Is this not the right place to get assistance for this kind of problem? Am I just being impatient?

avatar image perchik · Apr 14, 2014 at 05:25 PM 0
Share

Calm down.

Now, post more code. Your error is an index error, but your code doesn't access it. Somewhere in your code you do something like reports[i] or something and for whatever reason i is longer than the number of reports.

However, I'd note that the documentation says that you need Unity with iOS pro. (which is different than Unity Pro with iOS)

avatar image JIrwin · Apr 14, 2014 at 06:47 PM 0
Share

Thank you perchik. I've added "Update #1" to address your response. This may very well be license related, as you suggested.

avatar image perchik · Apr 14, 2014 at 06:54 PM 0
Share

yeah, my understanding of that line in the docs is that you have to have Pro for iOS...I've gotten caught in similar binds before when I had Pro, but not Android Pro. It's strange that it's throwing a out of range exception, but sometimes the licensing related content throws odd errors

avatar image JIrwin · Apr 14, 2014 at 07:02 PM 0
Share

Seems my trial should cover this, from http://unity3d.com/unity/download (emphasis $$anonymous$$e):

The free version of Unity for Windows. Includes publishing support for iOS, Android, Windows Store, Windows Phone, BlackBerry, desktop and Web, and a 30 day trial of Unity Pro (with Pro publishing for iOS, Android, Windows Store, Windows Phone and BlackBerry).

0 Replies

· Add your reply
  • Sort: 

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

22 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

Related Questions

iOS Xcode Error: Thread 1: EXC_BAD_ACCESS 3 Answers

iPhone Game Crashing During Application.Load 0 Answers

Crashing on iOS il2cpp RaiseOutofMemoryException 0 Answers

IOS Xcode crash only when connected to Xcode 0 Answers

Problem when building to development iPhone 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