Jni.h file not found

Jni.h file not found


I am integrating sharesdk in my game, i added the sharesdk folder and code, but when i run i get error

jni.h file not found

in file JniHelper.h

i am using this documentation - http://wiki.sharesdk.cn/cocos2d-x-3-x快速集成指南/

github - https://github.com/OSShareSDK/ShareSDK-For-Cocos2d-x-3.x/tree/master

i am running it on xcode for ios, so how to add the file. M using cocos2d-x 3.4 version…


You added too much code. JNI is Android specific. You shouldn’t have any JNI related file on iOS.

You need to remove JniHelper from Xcode. My guess is you included proj.android or other Android specific code in Xcode, which is not supposed to be there.

Note: JNI stands for Java Native Interface. There is no Java on iOS.


Yes theres an android folder in sharesdk folder, just removed it, thanks…

But i am getting this error now

<ShareSDK/ShareSDK.h> file not found.

in file C2DXiOSShareSDK.mm

i also added the url the url to sharesdk folder in search paths as solution found while i googled…but still the error is there…
any idea, please help…


You solve this problem?, if you did… can you share the solution?



Can you talk more about your issue? This is a 4 year old topic. I haven’t seen this issue in a very long time.


Hi thanks for you response, I solve this issue .

First JNI problem:

<jni.h> file not found.

First JNI as previously mentioned [Fradow] is Android specific, if you have any file with this import meaning you need delete reference for IOS project.


<ShareSDK/ShareSDK.h> file not found.

For some problem in XCODE ide not update reference for SDK ShareSDK. To solve this , i remove the SDK folder and import again. I don´t understand complete process but with this workaround i solve my problem.

Thanks slackmoehrle.