Search Unity

How to determine which default packages can be removed?

Discussion in 'Package Manager' started by jeremy1967, Jul 19, 2019.

  1. jeremy1967

    jeremy1967

    Joined:
    Jun 4, 2019
    Posts:
    68
    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.
     
  2. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @jeremy1967, is it possible to get a more detailed stacktrace from the crash?
     
  3. jeremy1967

    jeremy1967

    Joined:
    Jun 4, 2019
    Posts:
    68
    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 -

    Code (CSharp):
    1. - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
    2. {
    3.     if (_redirecting)
    4.         return;
    5.     if (error != nil)
    6.         UnityReportWebRequestNetworkError(self.udata, (int)[error code]);
    7.     UnityReportWebRequestFinishedLoadingData(self.udata);
    8. }
    9.  
    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.
     
    Last edited: Jul 19, 2019
  4. jeremy1967

    jeremy1967

    Joined:
    Jun 4, 2019
    Posts:
    68
    So, crash issues aside, is there an easy way to determine which packages can be safely removed (in general, not just my specific use-case)?
     
  5. dvapps

    dvapps

    Joined:
    Apr 16, 2019
    Posts:
    5
    Hi,

    I use unity 2019.3.b1 and crash when send pause/resume the player. Attach the screen with the crash.

    BR

    J
     

    Attached Files:

  6. jackcheng

    jackcheng

    Joined:
    May 17, 2013
    Posts:
    12
    @samuelb_unity i got some detail, anything help? please tell me if any step forwards.
     

    Attached Files:

  7. samuelb_unity

    samuelb_unity

    Unity Technologies

    Joined:
    Nov 13, 2017
    Posts:
    151
    Hi @jeremy1967,

    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:

    cannot remove dependent package.png

    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.

    Hi @jackcheng @docomodigitalapps,

    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:

    iap error.png

    So this is probably a question better suited to the In-App Purchasing forums I'm afraid:
    https://forum.unity.com/forums/unity-iap.112/