Hi. I am currently trying to trace the issue of my deployed app crashing on iPhoneX devices. As part of this effort, I would like to remove any of the default packages included by Unity on new project setup and rebuild my application. However, I don’t want to cause more problems by removing something that is required.
My app is a single-player game that does not require any special permissions of the phone and does not need network access. However, the crash logs keeps referring to, UnityReportWebRequestNetworkError, which suggests to me that something in my app is trying to access the user’s network.
Any ideas which of the default packages (as of Unity 2019.3.0a8) I can safely remove to ensure my app does not attempt network access?
Thanks. I wish I could but have been unsuccessful in obtaining. Perhaps I’m not looking in the right place? Apple’s App Store Connect site alerted me to the crashes and I was able to view in XCode’s crash logs, but there appears to be little there beyond reporting on the last line of the trace. There is an “Open in Project” option in XCode that takes me to the line where the error was thrown, but I have not been able to access any runtime data associated with the call.
Basically, it just takes me to this method in the editor which I assume is just about reporting the error, rather than showing me the logic which actually caused the error:
From UnityWebRequest -
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
{
if (_redirecting)
return;
if (error != nil)
UnityReportWebRequestNetworkError(self.udata, (int)[error code]);
UnityReportWebRequestFinishedLoadingData(self.udata);
}
As I said, there is no network/Web logic in my application so I’m not clear why this is happening.
EDIT: If it helps, this ONLY happens on iPhone X devices. Older iPhone models and Android phones are unaffected.
The easiest way would be to just remove the packages one by one via the Package Manager window. If you see an error message like this then the package was being used by another package, otherwise it should be safe to remove:
However, this only tells you about package dependencies. It doesn’t tell you whether your project was actually using code within that package. For example, if I add a package to my project, then write a script that uses some API from said package, when I remove that package I will get compilation errors in my project saying the type or namespace could not be found. We don’t currently have a means of warning the user that removing a package will cause compilation errors so this has to be done by trial and error.
Thank you for sharing those valuable screenshots. It appears that a web request was being made by the In-App Purchasing package, judging by this line of the stack trace: