Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Bug Error when building in 2022.3.5

Discussion in 'Unity IAP' started by andymads, Jul 24, 2023.

  1. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    This looks like a more general bug as I've seen it with other add capability calls since updating to 2022.3.5 but here it's coming directly from the In App Purchasing build code so though I'd mention it.

    WarningException: This capability has already been added. Method ignored
    UnityEditor.iOS.Xcode.PBXProject.AddCapability (System.String targetGuid, UnityEditor.iOS.Xcode.PBXCapabilityType capability, System.String entitlementsFilePath, System.Boolean addOptionalFramework) (at <ca5baea5210f43dba4e79596749d3a36>:0)
    UnityEditor.iOS.Xcode.ProjectCapabilityManager.AddInAppPurchase () (at <ca5baea5210f43dba4e79596749d3a36>:0)
    UnityEditor.Purchasing.AppleCapabilities.AddInAppPurchasingCapability (System.String projPath, UnityEditor.iOS.Xcode.PBXProject proj) (at ./Library/PackageCache/com.unity.purchasing@4.9.3/Editor/AppleCapabilities.cs:45)
    UnityEditor.Purchasing.AppleCapabilities.OnPostprocessBuildForApple (System.String path) (at ./Library/PackageCache/com.unity.purchasing@4.9.3/Editor/AppleCapabilities.cs:35)
    UnityEditor.Purchasing.AppleCapabilities.OnPostprocessBuild (UnityEditor.BuildTarget buildTarget, System.String path) (at ./Library/PackageCache/com.unity.purchasing@4.9.3/Editor/AppleCapabilities.cs:25)
    UnityEditor.Purchasing.AppleCapabilities.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at ./Library/PackageCache/com.unity.purchasing@4.9.3/Editor/AppleCapabilities.cs:19)
     
    DMorhachov likes this.
  2. Wriggler

    Wriggler

    Joined:
    Jun 7, 2013
    Posts:
    116
    I'm getting the same issue, but mine is coming from a custom post processing script. I'm doing something like this to suppress it:

    Code (CSharp):
    1.  
    2. //Add GameCenter capability
    3. try
    4. {
    5.     Logging.Log($"Adding GameCenter capability to target {targetGUID}");
    6.     project.AddCapability(targetGUID, PBXCapabilityType.GameCenter);
    7. }
    8. catch (Exception e)
    9. {
    10.     //Since Unity 2022.3.5f1 AddCapability() throws an exception which breaks builds (even though it's supposed to
    11.     //be a warning only). So we catch it here and only throw it up the chain if it isn't a warning type.
    12.     if (e is System.ComponentModel.WarningException)
    13.     {
    14.         Debug.LogWarning($"WarningException: {e.Message}");
    15.     }
    16.     else
    17.     {
    18.         throw e;
    19.     }
    20. }
    Obviously I guess you can't easily edit Unity's IAP code to add this, but if you're adding the capability yourself in your own post process script (which I assume you are, hence the error) then maybe you could do something like the above instead?

    It's a bit of a pain that they are making breaking changes like this in a point release... Unity is a nuisance these days.

    Ben
     
    michael_unity145 likes this.
  3. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    @Wriggler I didn't see this under 2022.3.3 and also my colleague is using that and is not getting this issue so it seems to be something that's made it's way into .4 or .5.
     
  4. Wriggler

    Wriggler

    Joined:
    Jun 7, 2013
    Posts:
    116
    Same here. I just upgraded from 2022.3.3f1 and wasn't getting it then.

    Ben
     
  5. RoflcopterInk

    RoflcopterInk

    Joined:
    Jul 15, 2021
    Posts:
    6
    Same here. Happening when using append during iOS build, replace works fine.
     
  6. leezak5555

    leezak5555

    Joined:
    Jan 16, 2020
    Posts:
    11
    Yup! Command+B (for build&run) doesn't work, but manually Going to Build Settings -> Build and Run -> Replace works for me.
     
    sd_trent likes this.
  7. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    250
    Getting this with 2022.3.7f1 "LTS". As others have said, replace works, but this is no good as it overwrites my info.plist and XCode project settings.
     
    Mishaps likes this.
  8. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    492
    Holy s***...I moved from 2022.3.4 bugs to 2022.3.7 for what?! Can you Unity "developers" team asnwer me? To get another critical process breaking bug?
    That's absolutely insane :eek:

    I have the same logs as @andymads provided.
    Yes, project replace "works", but of course we can't consider it as a working solution by a known reasons.

    Btw, did someone created a bug report? Forum threads doesn't work to force that lazy machine to fix it. Each thread will be finished with the words "please submit a bug report". Proofed by a time.

    If somone created a bug report, please share link, let's vote on.
     
    Last edited: Aug 16, 2023
  9. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    @novaVision I submitted a bug report yesterday from 2022.3.7.

    It's annoying that none of the Unity folks here have replied.
     
  10. sd_trent

    sd_trent

    Joined:
    Jul 1, 2017
    Posts:
    30
    wanted to just chime in and report that I've also experienced this, however leezak5555's solution worked perfect for me (oddly enough).
     
  11. RSH1

    RSH1

    Joined:
    Jul 9, 2012
    Posts:
    250
    Has there been any update on this? Having to completely re-do all my build settings every time I deploy on iOS is absolutely ridiculous for a "long term support" release.
     
    novaVision and sd_trent like this.
  12. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    492
    2022.3.8 was out, but no fix there, as expected
     
  13. michael_unity145

    michael_unity145

    Joined:
    Mar 8, 2022
    Posts:
    21
    This is ridiculous, just coming from this issue https://forum.unity.com/threads/crash-in-pbxprojectdata-writetostring.1465076/ where we were blocked on upgrading from anything above 2022.3.3f1 and had to deal with various editor crashes meanwhile. Was now able to implement the hack in the above thread and am now getting these new issues on incremental builds...

    We upgraded to 2022 because it was considered LTS. It is absolutely unacceptable that LTS patch releases breaks these many thing, another hack to the post process scripts.. I hope the Unity team can consider this feedback and be more defensive with changes in the future.
     
  14. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    492
    This topic were just ignored by Unity "support" team. Let me remind it been started on July 24th!
     
  15. jwtan_unity

    jwtan_unity

    Unity Technologies

    Joined:
    Nov 28, 2018
    Posts:
    12
    Here is the bug report that was very helpfully submitted by @andymads. Please vote on the case if you're experiencing the same problem. The dev team is currently looking into the bug.
     
  16. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    692
    bogmix and dave_oak like this.
  17. jwtan_unity

    jwtan_unity

    Unity Technologies

    Joined:
    Nov 28, 2018
    Posts:
    12
    @joshuacwilde I only just noticed your message. If nothing goes wrong, 2022.3.10f1 is expected to be released this week.
     
    joshuacwilde likes this.