@atin_agarwal2 wrote:
I'm trying to migrate to cocos2d-x version 3.12 from ver 3.4 but my app crashes when I try to call java methods from c++ code using JNI. It used to work earlier in 3.4 version but since they have changed the implementation for it.
Here's my code:java:
public static String guid()
{
UUID uuid = UUID.randomUUID();
String randomUUIDString = uuid.toString();
return randomUUIDString;
}C++:
string PlatformInterop::createGuid()
{
const std::string classPath = "com/cpyname/android/common/Utilities";
std::string guid = JniHelper::callStaticStringMethod(classPath, "guid");
return guid;
}Please help me out
Posts: 5
Participants: 2