Application crash on conversion JString to jstring
in Native
Hi ,
Some times the application is getting crashed because of conversion of JString to jstring using "env->NewStringUTF"
as it is giving ArrayIndexOutofbound Exception,
please help
Some times the application is getting crashed because of conversion of JString to jstring using "env->NewStringUTF"
as it is giving ArrayIndexOutofbound Exception,
please help
0
Comments
-
0
-
Hi Kaiserludi
void AndroidNetworkLogic::recieveData(const ExitGames::Common::JString& str)
{
jstring jstr = mEnv->NewStringUTF(str.UTF8Representation().cstr());
mEnv->CallVoidMethod(mObj, mRecievemethod, jstr);
mEnv->DeleteLocalRef(jstr);
}
this is the code that iam trying0 -
Hi @Harish_Kagale.
OK. That code looks fine to me.
Have yout tried loging the return value of str.UTF8Representation().cstr() before passing it to NewStringUTF, so that you coudl inspect it in the log in case of a crash? That way we coudl fine out for whch stirngs this is happening for you and try to reproduce it here.
Which SDK version are you using? If you are still below 4.0.5.0, then an update to the latest version may help, as older versions had some known issues with some Asian characters that may cause something like this.0 -
HI,
No i'm not logging the return value of str.UTF8Representation().cstr() , i'll try and let you know
I'm using Photon-AndroidNDK-Sdk_v4-1-2-00