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]
using UnityEditor;
public class CreateAssetBundles
{
[MenuItem ("Assets/Build AssetBundles")]
static void BuildAllAssetBundles ()
{
BuildPipeline.BuildAssetBundles ("AssetBundles");
}
}
[Assets/05_Script/AppcManager.cs]
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
using UniRx;
using UniRx.Triggers;
public class AppcManager : MonoBehaviour {
private const string _ITEM_ID_APPCSTAGE_ = "RemoveAd";
private static AppCCloud appCCloud;
public static BannerView bannerView;
void Awake() {
string ProductName = Application.productName;
DontDestroyOnLoad(this);
appCCloud = new AppCCloud().SetMK_iOS("XXXXX")
.On (AppCCloud.API.Purchase)
.Start ();
}
// Use this for initialization
void Start () {
//skip...
//
[Assets/Plugins/AppCCloud.cs]
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using MiniJSON;
public class AppCCloud
{
/// <summary>
/// API.
/// </summary>
public enum API
{
Data, Gamers, Purchase, Push, Reward,
}
/// <summary>
/// Horizon.
/// </summary>
public enum Horizon
{
Left, Center, Right,
}
/// <summary>
/// Vertical.
/// </summary>
public enum Vertical
{
Top, Bottom,
}
public _Ad Ad;
public _Data Data;
public _Gamers Gamers;
public _Purchase Purchase;
public _Push Push;
public _Reward Reward;
private string mk;
private static List<API> apis = new List<API>();
/// <summary>
/// Initializes a new instance of the <see cref="AppCCloud"/> class.
/// </summary>
public AppCCloud()
{
Ad = new _Ad();
}
/// <summary>
/// Raises the event.
/// </summary>
/// <param name="api">API.</param>
public AppCCloud On(API api)
{
apis.Add(api);
switch (api)
{
case API.Data:
Data = new _Data();
break;
case API.Gamers:
Gamers = new _Gamers();
break;
case API.Purchase:
Purchase = new _Purchase();
break;
case API.Push:
Push = new _Push();
break;
case API.Reward:
Reward = new _Reward();
break;
default:
break;
}
return this;
}
#if UNITY_EDITOR
/// <summary>
/// Sets the M k_i O.
/// </summary>
/// <returns>The M k_i O.</returns>
/// <param name="mk">Mk.</param>
public AppCCloud SetMK_iOS(string mk)
{
return this;
}
/// <summary>
/// Start this instance.
/// </summary>
public AppCCloud Start(){
return this;
}
/// <summary>
/// Opens the recovery view.
/// </summary>
public void OpenRecoveryView() {}
#elif UNITY_IPHONE
[DllImport("__Internal")]
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);
[DllImport("__Internal")]
private static extern int _isForegroundAd();
[DllImport("__Internal")]
private static extern void _showAppCCutinView();
[DllImport("__Internal")]
private static extern void _hideAppCCutinView();
[DllImport("__Internal")]
private static extern int _showingAppCCutin();
[DllImport("__Internal")]
private static extern void _showAppCMatchAppView(double horizontal, double vertical);
[DllImport("__Internal")]
private static extern void _hideAppCMatchAppView();
[DllImport("__Internal")]
private static extern int _openGamers();
[DllImport("__Internal")]
private static extern string _gamersGetNickname();
[DllImport("__Internal")]
private static extern int _gamersPlayCountIncrement();
[DllImport("__Internal")]
private static extern int _gamersGetPlayCount();
[DllImport("__Internal")]
private static extern void _gamersAddActiveLb(string[] lb_id, int count);
[DllImport("__Internal")]
private static extern int _gamersAddLbInt(int lb_id, int score);
[DllImport("__Internal")]
private static extern int _gamersAddLbDec(int lb_id, float score);
[DllImport("__Internal")]
private static extern string _gamersGetLb(int lb_id);
[DllImport("__Internal")]
private static extern void _startRecovery();
[DllImport("__Internal")]
private static extern void _dataStoreAddActiveData(string id);
[DllImport("__Internal")]
private static extern int _dataStoreIntegerWithKey(string key);
[DllImport("__Internal")]
private static extern string _dataStoreStringWithKey(string key);
[DllImport("__Internal")]
private static extern int _dataStoreSetIntegerWithKey(string key, int value);
[DllImport("__Internal")]
private static extern int _dataStoreSetStringWithKey(string key, string value);
[DllImport("__Internal")]
private static extern int _purchaseShowList();
[DllImport("__Internal")]
private static extern int _purchaseRestore();
[DllImport("__Internal")]
private static extern void _purchaseAddActiveItem(string key, string[] product_id, int count);
[DllImport("__Internal")]
private static extern int _purchaseUseCountWithKey(string key, int reduce);
[DllImport("__Internal")]
private static extern int _purchaseSetCountWithKey(string key, int count);
[DllImport("__Internal")]
private static extern int _purchaseGetCountWithKey(string key);
[DllImport("__Internal")]
private static extern string _purchaseGetJsonItem(string key);
public AppCCloud SetMK_iOS(string mk)
{
this.mk = mk;
return this;
}
public AppCCloud Start()
{
_setupAppCWithMediaKey(mk,
(Ad == null ? 0 : 1),
(Gamers == null ? 0 : 1),
(Push == null ? 0 : 1),
(Data == null ? 0 : 1),
(Purchase == null ? 0 : 1),
(Reward == null ? 0 : 1)
);
return this;
}
//skip...