So I have been having a week long ongoing problem with building my app to Xcode for IOS. After I updated Unity and Xcode I was unable to complete my build due to a “Lexical or Preprocessor Issue” which was “jni.h” file not found which is a directory for the Android plugin that is now coming with IOS build for some reason?
Does anyone know if I can just get rid of the Android plugin all together in anyway or how to fix the jni.h error?
I’ve updated Xcode command lines and JDK. Also I attempted to specify the direct headers path to the JDK file. Still comes up with the same problem.
Same issue there. I don’t have a real solution to solve it. But you can just delete the Android folder from the project in XCode (not in unity). You have to repeat this for every new build you want to make, but It allow me to build and continu working normally waiting for a better solution.
This entire time I had been deleting the Android folder directly from my Unity build and it never worked. I had no idea there was a difference removing it directly from Xcode. This fixed my problem. Thank you so much!
what importer settings do you have set for the files under that folder (in your Unity project) ?
Since those are .cpp files, they may be set to “all platforms”. you can probably mark them to be used only for Android.
Also - what’s the point of including a native library in your Unity project like that? is Unity running the ndk-build to compile that into a static library? i am pretty sure it doesn’t. You can compile that up front into a library and include that only for Android.
I’m going to try and find a way to delete the folder from the xcode project postbuild, just removing the folder on the filesystem is not enough.
It doesn’t make sense why unity would do this, there’s a clear convention of iOS and Android folders in Plugins, surely it’s just simple to strip the other folder during build.