Search Unity

Problem with On Demand Resources (ODR) when upgrade application

Discussion in 'iOS and tvOS' started by DziDAI, Oct 3, 2016.

  1. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hi all,

    We have our application in AppStore (with ODR support) and we are working on the update for this app right now.
    We encountered some problems with updating our app on iOS 10.
    Thing is that when we are updating store version of our app (installing new build from TestFlight over older version from the AppStore) it stops working on iOS 10. We found out that it happens in case of following mistake:
    "unable to open archive file: res://iOS" in AssetBundleDownloadFromODROperation in method FinishDownload, when it calls AssetBundle.LoadFromFile

    Main problem is following:
    During application update on iOS 10, application downloads new manifest for bundles (in my case "iOS") , but can't open it.
    On the other hand, if application is installed as new, it works well.

    How we can fix it?

    P.S.: On iOS9 we do not encounter any of this problems with the same app, everything works fine.
     
  2. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    428
    Hi,

    Do you reproduce the same issue with a stripped version of your app or bare AssetBunddleDemo project? Could it be that you've accidentally forgot to submit one or more of updated bundles?
     
  3. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hi @povilas

    No, it couldn't. Our application works well if it's installed as new in both iOS versions 9 and 10. This issue appeared after update application only on iOS 10, on iOS 9 it works well. Of course in a new version, we have more bundles

    I will try to reproduce this error with AssetBundleDemo, and let you know about results
     
  4. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hi @povilas

    I found out that this mistake occurs only when you install new build from TestFlight over AppStore (Released build).
    I’ve tried to install builds from test flight, and this error did not repeat. Also this error reveals itself in AssetBundleDemo project if you install it over previously installed version from AppStore.

    I’ve tried many different combinations, renaming bundles, changing number of bundles, but result is always the same, if you install new version over AppStore version you get “unable to open archive file res://...”
    Builds are working well if you install them from TestFlight on clean device.

    I think that problem is that during the update of AppStore version of the app, ODR are not being clean up for the old version or something like that.

    If there are any methods to clean up ODR?
     
  5. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
  6. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hey @povilas

    The same problems present on tvOS. When a user wants to update the old version, he get error “unable to open archive file res://...”. Bundles are not overwritten after update app
     
  7. helios

    helios

    Joined:
    Oct 5, 2009
    Posts:
    305
    I can't even get the bundles to work for the first time, period. How are you all even getting ODR to work?? I keep getting the same "unable to open archive file res://" no matter what I do. Even Unity's own demos for ODR don't work.
     
  8. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hello @helios

    This is very strange, AssetBundleDemo works fine. Maybe you forget enable On Demand Resources in project settings?
     
  9. helios

    helios

    Joined:
    Oct 5, 2009
    Posts:
    305
    Yep, sure am. I'm thinking there's something more fundamental I'm missing, but not sure what. I actually just tested it without my Xcode "debug executable" option turned on and it worked. If I turn debug executable on, it doesn't work (talking about the demo here). Strange.
     
  10. aresundnes

    aresundnes

    Joined:
    Apr 29, 2013
    Posts:
    3
    We're having the same issue - and just between two different versions from Testflight. Deleting the app and reinstalling fixed it, but I'm a bit worried about how this will work in future LIVE updates..! If it's only Testflight then it's no big deal i guess
     
  11. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    We have also been facing this issue with no solution:
    https://forum.unity3d.com/threads/t...ileasync-returns-null-with-testflight.442877/

    Has there been any progress on this? Has anyone filed a bug report? This is a very stressful situation because if we can't update our tvOS version, we will lose an opportunity to get an App Store promo.

    EDIT: I filed a bug report (Case 855726) in case no one reported this.
     
    Last edited: Nov 28, 2016
  12. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hello @rrsimon ,

    I don't have any progress in resolving this issue.

    I think now the guys from unity (@povilas ) find the problem and fix it asap, on both platforms iOS and tvOS.
     
  13. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    Hello,

    Yes, povilas is in touch with us to take a look at this issue. I also found an Apple bug report from someone else experiencing this without the Unity Engine : https://openradar.appspot.com/29218750 . We found a "workaround" in the mean time. By using the same Unity beta version (5.3.0p0) and Xcode 7.2, we were able to overwrite our AppStore build with a TestFlight build using the exact same asset bundles as the last build we shipped. This might not satisfy everyone needs but it works for us since all we needed to do was update our Apple Dashboard settings using a new ipa.

    Thanks
     
    DziDAI likes this.
  14. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    To be sure, you built ipa using 5.3.0p0 and Xcode 7.2 and published it in the AppStore, and the problem was solved?
     
    Last edited: Dec 3, 2016
  15. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    Yes we synched our subversion revision to the same as last year's so everything was the same as our previous store build. Then we rebuild a new ipa using the same Unity 5.3.0p0 and Xcode 7.2. I did a few fixes (for instance the russian system font was broken on tvOS 10+) and we could get our build overwrite our previous AppStore build with TestFlight. Everything is good on our side since we just wanted to update our game with minor fixes.

    I don't know how anyone with new AssetBundles could get a new build going though. Maybe building asset bundles with old Unity+Xcode will make them overwrite properly? We haven't tested that because we finally had a build we could get out the door.
     
  16. helios

    helios

    Joined:
    Oct 5, 2009
    Posts:
    305
    Is there any update to this? I just tried a new build for tvOS via TestFlight and levels with new asset bundles were all completely pink (the whole screen). Uninstalled, then reinstalled and everything was fine. Is this a TestFlight thing or is the live app going to have the same issue? Thanks.
     
  17. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    It seems like an ongoing thing according to the https://openradar.appspot.com/29218750 thread. On our side, we have tried our application with the latest Xcode 8.2 and it was still broken. I don't know if Apple is still working on a fix since the last reply dates from December 15.
     
  18. Colin49

    Colin49

    Joined:
    Oct 2, 2013
    Posts:
    9
    So we just ran into this issue ourselves and are quite nervous about launching our app with Asset Bundles + ODRs. We don't want to get stuck in a situation where users can't update our app.

    Was anyone able to find a solution to this?

    We are using Unity 5.4.5f1 and we see this on iOS 9.x & 10.x.
     
    Last edited: May 8, 2017
  19. Binarific

    Binarific

    Joined:
    Jul 1, 2014
    Posts:
    3
    We also experiencing this issue. We need to update our app but are unable to do so because the updated version will not download any ODRs.
    Does anybody know a solutions or workaround?
    We are using Unity 5.6.1p1.
     
  20. rrsimon

    rrsimon

    Joined:
    Apr 16, 2012
    Posts:
    27
    The only really bad workaround we could do was to re-upload the same ODR as our initial version with the same old Xcode and Unity version. The only thing I could change was code to include bug fixes...

    I spent a good week and could not figure any way to update my ODR assets so good luck to anyone who has to change them.

    The good news is that TVOS now permits much bigger apps so maybe you could try updating your app with no ODR at all and my guess is that all of your assets will be included with your app instead of having to be downloaded.
     
  21. Ner1Co

    Ner1Co

    Joined:
    Jun 15, 2017
    Posts:
    2
    Same issue here, anyone have any news? this bug makes ODR useless.
     
  22. DziDAI

    DziDAI

    Joined:
    Dec 6, 2012
    Posts:
    67
    Hey @Ner1Co

    Just turn off ODR, and wait iOS 11
     
  23. majormega

    majormega

    Joined:
    Sep 5, 2015
    Posts:
    4
    I might have found a potential fix for this: ditch iOS 9 and compile for iOS 10. This seemed to do the trick for us...seems like iOS 10 introduced a new way to manage ODR and it doesn't get included when compiling for iOS 9. I'll post back here again if I find any more info.

    EDIT: iOS 9 is still at about 11% of users, but they should still have access to old version.
     
  24. Ner1Co

    Ner1Co

    Joined:
    Jun 15, 2017
    Posts:
    2
    @majormega did you try to upload and update from the previous version? We've uploaded our app to TestFlight when the deployment target is iOS 10 and the issue is still there.
     
  25. majormega

    majormega

    Joined:
    Sep 5, 2015
    Posts:
    4
    @Ner1Co I meant to follow up on this - things got really weird on our end. In order not to mess up our version numbers, I deployed our app under a different Apple Bundle ID to TestFlight for iOS 10 only. When updating an ODR package, the changes came through on update without a fresh install. I thought we had found success and came on here to write the previous message.

    However, when switching back to our real Bundle ID, using the exact same build out of Unity, the changes didn't work on update. The only thing I can think of that is different between the two is that I've made IAP sandbox purchases on our real Bundle ID, but never on the temporary one I tested with. So I have no idea why it worked on a different Bundle ID. Still incredibly frustrated with ODR...
     
  26. jeffsherwin

    jeffsherwin

    Joined:
    Aug 22, 2014
    Posts:
    47
    Not sure where to post but this seems applicable . . .

    Been trying to get On Demand Resources working on Testflight. Works in xcode but crashes in Testflight immediately.
    Been using Xcode 9 and iOs 10.3.3 and 11.03. No luck

    Are you all saying in this thread that ODR is useless for the App Store?
    Seems like this has been in play for over a year.
    Any idea on resolution or something i am missing?
     
  27. JeffScm

    JeffScm

    Joined:
    Oct 18, 2013
    Posts:
    15
    Unity 2017.1 Xcode 9 and still no lucky with ODR...
     
  28. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,367
  29. joshjet22

    joshjet22

    Joined:
    Dec 10, 2017
    Posts:
    1
    Well after 7 days of pain I have found an actual solution to this issue In my situation the issue was resolved by adding a single "Initial Install" tagged ODR resource to the app.

    1. Add a small file you won't use to the app
    2. Add an ODR tag to that file
    3. Open the project settings, enter the Resource Tags section, and select Prefetch
    4. Add the tag that you just created to the "Initial Install Tags" section.

    In my case I didn't have any pre-install tagged resources, so I added a dummy image with an ODR tag and put it in the pre-install bucket. After that, problem solved. Can't say if that will do it for everyone, but I was having this problem 100% of the time, and for me this was a 100% always works solution. tvOS 10, tvOS 11.2.
     
    DziDAI likes this.
  30. Colin49

    Colin49

    Joined:
    Oct 2, 2013
    Posts:
    9
    I can confirm that the approach Joshjet22's implemented works for us as well.