question

Michael Webb avatar image
Michael Webb asked

CANNOT_INITIALIZE (C++)

Is there any documentation that explains exactly what you are supposed to do so you don't get the CANNOT_INITIALIZE error? My app is C++ with JNI and COCOS2dx, but it's just the straight android/java code that I can't get working. I just don't get the documentation - I can't seem to find step by step instructions. My setup is is Mac, Android ADT and debugging on a kindle fire HDX. When I'm debugging just what am I supposed to at the API stage when setting up game circle? I've tried MD5 key for the signed app as created for the store, and i've tried the one extracted from the APK that ADT creates when you debug, but neither work. The documentation just seems to go round in circles! Any help gratefully received - this is the first time I've failed to get anything like this working!
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Michael Webb avatar image
Michael Webb answered
In case anyone else is having similar projects, I think I've figured it out. The method is similarish to the one for Google Play but their documentation is slightly clear. I'm pretty sure you need to add two API keys, one for debug and one for live. For the debug one you get the MD5 key from Eclipse >> Preferences >> Android >> Build. You then make the api_key.txt and put it into the resources folder for your project (not eclipse assets - the cocos2dx build process replaces the Assets with Resources each time you build). I'm pretty sure you then need to replace the api_key.txt with the live one before submitting. You get that MD5 key when you export to build the APK file, and then repeat the process to get a new api_key.txt. It's not gone live yet, so I'll confirm once it's live.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.