Search Unity

Question Timeline null problem and 2D bone animation inoperative error when loading scene with asset bundle

Discussion in 'Asset Bundles' started by Kangkyeonghun, Jun 8, 2023.

  1. Kangkyeonghun

    Kangkyeonghun

    Joined:
    Jun 17, 2021
    Posts:
    15
    First, I wrote with a translator, so the writing might be weird, so please understand this

    Hello, I'm working on UNI.T's 2021.3.2f1
    Currently, Timeline, I worked using this animation And there is no problem when building Android and IOS with apk for individual scenes And when I loaded and executed the scene with the set bundle in the PC editor, it worked well without any problems However, after building on Android and IOS, if you load and run the scene with the set bundle, but it doesn't work with Timeline null, the 2D animation will also stop working as it was at the beginning So I changed the setting to check if it was a setting problem, but it didn't work However, when I changed Mono from IL2CPP, built apk, loaded thin as an aesset bundle, and ran it, timeline and 2d bone animation worked well However, there was a problem that AR foundation was not possible when I built it with Mono So you can't build with Mono and you have to build with IL2CPP only And google it and limk.xml can add the code to the xml and add it to the Asset folder, so we also use that method, but the problem has not been solved So please let me know if there is a way to solve a problem similar to mine

    link.xml
    Code (CSharp):
    1. <linker>
    2.     <assembly fullname ="UnityEngine.Timeline" preserve="all"/>
    3.     <assembly fullname ="UnityEngine">
    4.         <namepsace fullname ="UnityEngine,Playables" preserve="all"/>
    5.     </assembly>
    6. </linker>
     

    Attached Files:

    • 1.png
      1.png
      File size:
      179.6 KB
      Views:
      59
    • 1.5.png
      1.5.png
      File size:
      28.1 KB
      Views:
      60
    • 2.png
      2.png
      File size:
      106.8 KB
      Views:
      59
    • 3.png
      3.png
      File size:
      111.4 KB
      Views:
      58
    • 4.png
      4.png
      File size:
      39.1 KB
      Views:
      63
  2. Kangkyeonghun

    Kangkyeonghun

    Joined:
    Jun 17, 2021
    Posts:
    15
    In addition, 2D animation and Timeline were added in package manager
     

    Attached Files:

    • 6.png
      6.png
      File size:
      74.4 KB
      Views:
      56
  3. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    91
    Hi!

    This does sound very much like a code stripping problem, because il2cpp by default does code stripping. There are settings to reduce or disable the stripping, that can help at least to test that this is the issue.

    If you build your AssetBundles with BuildPipeline.BuildAssetBundles() then the convenient way to control code stripping is by passing the manifest file generated by the AssetBundle build into your player build.

    https://docs.unity3d.com/2023.2/Doc...ildPlayerOptions-assetBundleManifestPath.html

    Link.xml can also work but I'm not so familiar with the syntax and way to force the build to read that file.
     
  4. Kangkyeonghun

    Kangkyeonghun

    Joined:
    Jun 17, 2021
    Posts:
    15
    First, I wrote with a translator, so the writing might be weird, so please understand this

    Thanks to your reply, it was a great hint to solve the problem
    The cause was a code stripping problem And the other problem was that I was using timeline and bone 2D animation in the set bundle thin file, but I wasn't using the timeline and bone 2D animation in this project So maybe code stripping will delete timeline and this 2D animation So, as a solution, we created an object in this project, added the timeline and this 2D animation to that object, and we re-built it, and this time we confirmed that timeline and this 2D animation are working normally Thanks to your reply, I was able to solve the problem
     
  5. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    91
    I'm glad to hear that your problem is solved!

    You had a good idea to add a reference in your player build to the components you want to use inside AssetBundles. That is a simply way to make sure that it is not stripped.