x


How to make external C# dll library loadable (reflection) on iPhone?

Hello,

My dll is generated from a simple class:

  using UnityEngine;

  public class TestDll : MonoBehaviour {
    public void Awake() {
        Debug.Log("-> TestDll.Awake()");
    }
    public void Start() {
        Debug.Log("-> TestDll.Start()");
    }
    public void Test() {
        Debug.Log("-> TestDll.Text()");
    }
  }

I put the dll under application's Document folder on iPhone, and use folloing code to load it:

  Assembly assem = Assembly.Load(File.ReadAllBytes(Application.persistentDataPath + "/TestDll.dll"));

But I got error:

Non platform assembly: data-0x31c7e00 (this message is harmless) Failed to load AOT module 'data-0x31c7e00.dylib' in aot-only mode.

Then I did "mono --aot=full Test.dll" in Cygwin, and replaced it on iPhone, I got another error:

Non platform assembly: data-0xb16b000 (this message is harmless) Unhandled Exception: System.BadImageFormatException:

I googled, but didn't find answers.

Has anyone tried the same thing before? How did you make it?

Thank you

more ▼

asked Mar 30 '12 at 12:27 PM

ting gravatar image

ting
1 2 2 2

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2026
x2013
x246
x22
x5

asked: Mar 30 '12 at 12:27 PM

Seen: 887 times

Last Updated: Mar 30 '12 at 12:27 PM