Search Unity

[Closed]CS1061 error only building Assetbundle

Discussion in 'Scripting' started by joeee19, Sep 13, 2015.

  1. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    Good evening.

    The error of a method not being found in CS1061 when I am going to make it building AssetBundle. This error is not happen in Play on UnityEditor , and build and run on iOS. It's works fine. but this happen [only] building Assetbundle.

    Why? Do you not understand a cause?

    [error message] Assets/05_Script/AppcManager.cs(xx,xx): error CS1061: Type AppCCloud' does not contain a definition for SetMK_iOS' and no extension method SetMK_iOS' of type AppCCloud' could be found (are you missing a using directive or an assembly reference?)

    Assets/05_Script/AppcManager.cs(xx,xx): error CS1061: Type AppCCloud._Purchase' does not contain a definition for OpenPurchaseView' and no extension method OpenPurchaseView' of type AppCCloud._Purchase' could be found (are you missing a using directive or an assembly reference?)

    AppCCloud.cs of the origin of summons is placed right under /Assets/Plugins folder and should finish an initial compilation. Actually, a trouble does not go for a normal play. Will any special compilation occur only when I do BuildAssetBundles?

    I Use Unity5.1.3p3 which was just shown yesterday.

    [making script of AssetBundle on /Assets/Editor/CreateAssetBundles.cs]

    Code (CSharp):
    1. using UnityEditor;
    2. public class CreateAssetBundles
    3. {
    4.      [MenuItem ("Assets/Build AssetBundles")]
    5.      static void BuildAllAssetBundles ()
    6.      {
    7.          BuildPipeline.BuildAssetBundles ("AssetBundles");
    8.      }
    9. }
    [Assets/05_Script/AppcManager.cs]
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using GoogleMobileAds.Api;
    4. using UniRx;
    5. using UniRx.Triggers;
    6.  
    7. public class AppcManager : MonoBehaviour {
    8.  
    9.     private const string _ITEM_ID_APPCSTAGE_ = "RemoveAd";
    10.  
    11.     private static AppCCloud appCCloud;
    12.  
    13.     public static BannerView bannerView;
    14.  
    15.     void Awake() {
    16.  
    17.         string ProductName = Application.productName;
    18.  
    19.  
    20.         DontDestroyOnLoad(this);
    21.  
    22.         appCCloud = new AppCCloud().SetMK_iOS("XXXXX")
    23.             .On (AppCCloud.API.Purchase)
    24.             .Start ();
    25.     }
    26.  
    27.     // Use this for initialization
    28.     void Start () {
    29. //skip...
    30. //    

    [Assets/Plugins/AppCCloud.cs]

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using System.Runtime.InteropServices;
    5. using MiniJSON;
    6.  
    7. public class AppCCloud
    8. {
    9.    
    10.     /// <summary>
    11.     /// API.
    12.     /// </summary>
    13.     public enum API
    14.     {
    15.         Data, Gamers, Purchase, Push, Reward,
    16.     }
    17.    
    18.     /// <summary>
    19.     /// Horizon.
    20.     /// </summary>
    21.     public enum Horizon
    22.     {
    23.         Left, Center, Right,
    24.     }
    25.    
    26.     /// <summary>
    27.     /// Vertical.
    28.     /// </summary>
    29.     public enum Vertical
    30.     {
    31.         Top, Bottom,
    32.     }
    33.  
    34.     public _Ad Ad;
    35.     public _Data Data;
    36.     public _Gamers Gamers;
    37.     public _Purchase Purchase;
    38.     public _Push Push;
    39.     public _Reward Reward;
    40.    
    41.     private string mk;
    42.     private static List<API> apis = new List<API>();
    43.    
    44.     /// <summary>
    45.     /// Initializes a new instance of the <see cref="AppCCloud"/> class.
    46.     /// </summary>
    47.     public AppCCloud()
    48.     {
    49.         Ad = new _Ad();
    50.     }
    51.    
    52.     /// <summary>
    53.     /// Raises the  event.
    54.     /// </summary>
    55.     /// <param name="api">API.</param>
    56.     public AppCCloud On(API api)
    57.     {
    58.         apis.Add(api);
    59.         switch (api)
    60.         {
    61.         case API.Data:
    62.             Data = new _Data();
    63.             break;
    64.         case API.Gamers:
    65.             Gamers = new _Gamers();
    66.             break;
    67.         case API.Purchase:
    68.             Purchase = new _Purchase();
    69.             break;
    70.         case API.Push:
    71.             Push = new _Push();
    72.             break;
    73.         case API.Reward:
    74.             Reward = new _Reward();
    75.             break;
    76.         default:
    77.             break;
    78.         }
    79.         return this;
    80.     }
    81.    
    82.     #if UNITY_EDITOR
    83.     /// <summary>
    84.     /// Sets the M k_i O.
    85.     /// </summary>
    86.     /// <returns>The M k_i O.</returns>
    87.     /// <param name="mk">Mk.</param>
    88.     public AppCCloud SetMK_iOS(string mk)
    89.     {
    90.         return this;
    91.     }
    92.    
    93.     /// <summary>
    94.     /// Start this instance.
    95.     /// </summary>
    96.     public AppCCloud Start(){
    97.         return this;
    98.     }
    99.     /// <summary>
    100.     /// Opens the recovery view.
    101.     /// </summary>
    102.     public void OpenRecoveryView() {}
    103.  
    104.     #elif UNITY_IPHONE
    105.    
    106.     [DllImport("__Internal")]
    107.     private static extern void _setupAppCWithMediaKey(string mk, int opt_ad, int opt_gamers, int opt_push, int opt_data, int opt_purchase, int opt_reward);
    108.     [DllImport("__Internal")]
    109.     private static extern int _isForegroundAd();
    110.     [DllImport("__Internal")]
    111.     private static extern void _showAppCCutinView();
    112.     [DllImport("__Internal")]
    113.     private static extern void _hideAppCCutinView();
    114.     [DllImport("__Internal")]
    115.     private static extern int _showingAppCCutin();
    116.     [DllImport("__Internal")]
    117.     private static extern void _showAppCMatchAppView(double horizontal, double vertical);
    118.     [DllImport("__Internal")]
    119.     private static extern void _hideAppCMatchAppView();
    120.    
    121.     [DllImport("__Internal")]
    122.     private static extern int _openGamers();
    123.     [DllImport("__Internal")]
    124.     private static extern string _gamersGetNickname();
    125.     [DllImport("__Internal")]
    126.     private static extern int _gamersPlayCountIncrement();
    127.     [DllImport("__Internal")]
    128.     private static extern int _gamersGetPlayCount();
    129.     [DllImport("__Internal")]
    130.     private static extern void _gamersAddActiveLb(string[] lb_id, int count);
    131.     [DllImport("__Internal")]
    132.     private static extern int _gamersAddLbInt(int lb_id, int score);
    133.     [DllImport("__Internal")]
    134.     private static extern int _gamersAddLbDec(int lb_id, float score);
    135.     [DllImport("__Internal")]
    136.     private static extern string _gamersGetLb(int lb_id);
    137.    
    138.     [DllImport("__Internal")]
    139.     private static extern void _startRecovery();
    140.    
    141.     [DllImport("__Internal")]
    142.     private static extern void _dataStoreAddActiveData(string id);
    143.     [DllImport("__Internal")]
    144.     private static extern int _dataStoreIntegerWithKey(string key);
    145.     [DllImport("__Internal")]
    146.     private static extern string _dataStoreStringWithKey(string key);
    147.     [DllImport("__Internal")]
    148.     private static extern int _dataStoreSetIntegerWithKey(string key, int value);
    149.     [DllImport("__Internal")]
    150.     private static extern int _dataStoreSetStringWithKey(string key, string value);
    151.    
    152.     [DllImport("__Internal")]
    153.     private static extern int _purchaseShowList();
    154.     [DllImport("__Internal")]
    155.     private static extern int _purchaseRestore();
    156.     [DllImport("__Internal")]
    157.     private static extern  void _purchaseAddActiveItem(string key, string[] product_id, int count);
    158.     [DllImport("__Internal")]
    159.     private static extern int _purchaseUseCountWithKey(string key, int reduce);
    160.     [DllImport("__Internal")]
    161.     private static extern int _purchaseSetCountWithKey(string key, int count);
    162.     [DllImport("__Internal")]
    163.     private static extern int _purchaseGetCountWithKey(string key);
    164.     [DllImport("__Internal")]
    165.     private static extern string _purchaseGetJsonItem(string key);
    166.  
    167.     public AppCCloud SetMK_iOS(string mk)
    168.     {
    169.         this.mk = mk;
    170.         return this;
    171.     }
    172.    
    173.     public AppCCloud Start()
    174.     {
    175.         _setupAppCWithMediaKey(mk,
    176.                                (Ad == null ? 0 : 1),
    177.                                (Gamers == null ? 0 : 1),
    178.                                (Push == null ? 0 : 1),
    179.                                (Data == null ? 0 : 1),
    180.                                (Purchase == null ? 0 : 1),
    181.                                (Reward == null ? 0 : 1)
    182.                                );
    183.         return this;
    184.     }
    185. //skip...
     
  2. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    I solved.

    I was miss set option EditorUserBuildSettings.activeBuildTarget of 3 argument.