Search Unity

Caught exception invoking method when calling BuildAssetBundles method in Post-Export Method

Discussion in 'Unity Build Automation' started by JonMoon, Oct 27, 2017.

  1. JonMoon

    JonMoon

    Joined:
    Feb 26, 2015
    Posts:
    10
    I get the following error when calling BuildPipeline.BuildAssetBundles in a method specified by Post-Export Method.

    [Unity] ERROR: Caught exception invoking method 'PostExportMethod': parameters do not match signature

    I have confirmed that the method does indeed run via debug log statements. It is only until Unity Cloud reaches the BuildAssetBundles statement does the above error occur.

    Code (CSharp):
    1.   var abb = new AssetBundleBuild[1];
    2.   abb[0] = new AssetBundleBuild();
    3.   abb[0].assetBundleName = abName;
    4.   abb[0].assetNames = new string[] { "encrypted_data" };
    5. #if ANDROID
    6.   BuildPipeline.BuildAssetBundles( Path.Combine( Application.dataPath, abName ), abb, BuildAssetBundleOptions.None, BuildTarget.Android );
    7. #else
    8.   BuildPipeline.BuildAssetBundles( Path.Combine( Application.dataPath, abName ), abb, BuildAssetBundleOptions.None, BuildTarget.iOS );
    9. #endif
    Is there something wrong with my code? abName is not an empty string.
     
  2. JonMoon

    JonMoon

    Joined:
    Feb 26, 2015
    Posts:
    10
    BuildPipeline.BuildAssetBundles first parameter was bad. Instead of just being a path (Application.dataPath) it also has the name of the assetbundle (abName). The error UnityCloud displayed should have said something along the lines of BuildAssetBundles failing instead of PostExportMethod failing