Hi, I imported a plugin into my project and am getting these errors… the NatCam plugin imports just fine in any other project …
Assets/NatCam/Extended/Plugins/Managed/Platforms/Android/NatCamAndroid.cs(92,38): error CS0117: AndroidJNI' does not contain a definition for ToByteArray
Assets/NatCam/Extended/Plugins/Managed/Platforms/Android/NatCamAndroid.cs(94,45): error CS1061: Type jvalue' does not contain a definition for i’ and no extension method i' of type jvalue’ could be found (are you missing a using directive or an assembly reference?)
Assets/NatCam/Extended/Plugins/Managed/Platforms/Android/NatCamAndroid.cs(96,24): error CS0117: AndroidJNI' does not contain a definition for CallStaticVoidMethod’
obviously something is weird with Unity (or Android SDK???) within my project and not Natcam. Any idea what the heck is going on? This is Unity 5.3.6f1 but it imports just fine in a different project with the same version of Unity.
Is it possible that there were extension methods defined for certain types, but you did not include those in your project? perhaps it is not part of the “NatCam” plugin itself ?
You can create extension methods, these are just static methods that are using the compiler’s help to make them seem as if they’re associated to a given object instance. For example:
public static class JValueExtensions
{
public static void Extension(this jvalue v)
{
// DO SOMETHING HERE
}
}
// Use the new method
jvalue jv = .... // get a jvalue somehow
jv.Extension();
Other things that may be the case for what you describe:
In another project, you’ve selected a different platform than the one you’re currently using.
You didn’t import ALL the plugin code that was required.
It would be helpful if you could post the code from the lines that the compiler is complaining about.
Also, in the project that this works in, try to look for the methods that are missing: CallStaticVoidMethod and ToByteArray. See where they’re defined. It can help shed some more light on this issue.