Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Skinned Mesh Renderer Not Visible in IOS build Asset Bundle

Discussion in 'Asset Bundles' started by wizAR_learning, Jun 14, 2017.

  1. wizAR_learning

    wizAR_learning

    Joined:
    Nov 24, 2016
    Posts:
    1
    Hi There,

    I have been working with Asset Bundles from a long time on android, but recently I made IOS asset bundle and I got this weird bug, i.e. After downloading asset bundle on ios device, everything works perfectly, all canvas, sprites, mesh renderer, eveything loads and work perfectly, only those 3D models which uses skinned mesh renderer (as there is bone animation on those) are not visible.

    Anyone out there or from unity itself please help. As unity is cross-platform, this kind of bug should never occur in first place.
     
    cokoch likes this.
  2. cokoch

    cokoch

    Joined:
    Jun 13, 2017
    Posts:
    1
    Is there a solution for this problem by now. Two years later and I struggle with a similar problem. In my case the app is crashing trying to load models with skinned mesh renderer.

    Edit: Unchecking "Strip Engine Code" in the Player-Settings worked for me.
     
    Last edited: Jul 23, 2019
  3. HnS_Alexa

    HnS_Alexa

    Joined:
    Jan 23, 2019
    Posts:
    10
    for me its not working. any other solution?
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    All features that are used by asset bundles must also be "used" by main game. This can be done by either providing link.xml listing scripting classes you don't want to be stripped, or by having a dummy scene in game using those features.
     
  5. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    114
    Thank you. This was the answer I needed. I included a dummy scene in the build which contained a skinned mesh renderer and a cloth component. That made the skinned mesh component work but it kept stripping the cloth functionality. I created the list.xml and included the code below and it all worked.

    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="UnityEngine.ClothModule" preserve="all"/>
    3. </linker>
     
  6. lntoan123

    lntoan123

    Joined:
    Apr 1, 2019
    Posts:
    15
    <assembly fullname="UnityEngine"> <type fullname="UnityEngine.SkinMeshRenderer" ignoreIfMissing="1" preserve="all" required="true"/>

    Added these line codes on link.xml but I still get issue: SkinMeshRenderer component on assetbundle is Stripped once build unity il2cpp.
    Error on android:
    Could not produce class with ID 137. This could be caused by a class being stripped from the build even though it is needed. Try disabling 'Strip Engine Code' in Player Settings.

    Do you have any idea? @Aurimas-Cernius
     
  7. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    89
    If you compile your AssetBundles with BuildPipeline.BuildAssetBundles:

    then you can avoid code stripping of types that are only used in your AssetBundles by passing the path to the main .manifest file in the BuildPlayerOptions structure that you pass to BuildPipeline.BuildPlayer()

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

    The link.xml is another valid approach, that is what Addressables uses and can be setup manually as well for exactly this purpose. I'm not sure why it didn't work for you Intoan123. The "Could not produce class with ID 137" error does indeed refer to SkinnedMeshRenderer (according to https://docs.unity3d.com/Manual/ClassIDReference.html). So i would guess its something specific about the content that you put inside the file.