🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Unity3D:Field text or type signature not found when i try to reach a static string inside a Jar android plugin

Started by
2 comments, last by Yaguedid 3 years, 9 months ago

Hi Guys ,

Recently i've developed a service that transfers data over bluetooth on android and an android plugin that receives the intents from the service so i can extract data from them in unity.

i have created Plugins/Android folders inside Assets folder in unity which i have placed the jar file with the AndroidManifest. The problem is that whenever i try to reach the class inside the plugin and try to get a static string using GetStatic it gives me this error:

Exception: Field text or type signature  not found

this is the part of C# code where i try to connect to the plugin class :

 AndroidJavaObject jc=new AndroidJavaObject("com.game.receiverUnity.Receiver");
  jc.CallStatic("createInstance");

  javaMessage = jc.GetStatic<string>("text");

None

Advertisement

Just a guess, but unlike the public C#-representation of things, unity usually prefixes fields with something like “m_”, so you might want to try to read the field as m_text. As least thats what you usually have to do when working with reflection in C# for private fields.

I was so dump ..

The problem is that i was trying to test the project in the editor ..and since that library is a different architecture (ARM or MIPS usually) windows will not understand it so he cant access it .

The projec works fine like expected in android device.

None

This topic is closed to new replies.

Advertisement