Hi,
When opening in Eclipse the project created by create_project.py, Ecplise reports lots of errors in the main Java file.
For example:
package org.cocos2dx.hellocpp;
import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
All these lines are marked as errors.
Any suggestions?
Thanks
Jose
have you opened the library project ‘cocos2dx’ ?
yes, I added it to the workspace
Same issue here! main.app also has similar errors. Any idea?
Please checkout
* import cocos2dx/platform/android/java into eclipse
* build the imported project
Thanks! It works:)
I just upgrade from 2.1.4 to 2.2, and I found the CCRenderTexture is lost when app goes to background, not sure why, I created a message about this issue, could you please help look at this? Thanks so much:) http://www.cocos2d-x.org/forums/6/topics/36876
Minggo Zhang wrote:
Please checkout
* import cocos2dx/platform/android/java into eclipse
* build the imported project
fabiobh
October 9, 2013, 10:35pm
#7
Do you remember to update the main.cpp file?
I create a new project using create_project.py, the current main.cpp is:
#include “AppDelegate.h”
#include “cocos2d.h”
#include “CCEventType.h”
#include “platform/android/jni/JniHelper.h”
#include <jni.h>
#include <android/log.h>
#define LOG_TAG “main”
#define LOGD (…) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,VA_ARGS )
using namespace cocos2d;
extern “C”
{
jint JNI_OnLoad(JavaVM vm, void reserved)
{
JniHelper::setJavaVM(vm);
return JNI_VERSION_1_4;
}
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h)
{
if (!CCDirector::sharedDirector()->getOpenGLView())
{
CCEGLView view = CCEGLView::sharedOpenGLView;
view->setFrameSize;
AppDelegate pAppDelegate = new AppDelegate();
CCApplication::sharedApplication()->run();
}
else
{
ccGLInvalidateStateCache();
CCShaderCache::sharedShaderCache()->reloadDefaultShaders();
ccDrawInit();
CCTextureCache::reloadAllTextures();
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_FOREGROUND, NULL);
CCDirector::sharedDirector()->setGLDefaultValues();
}
}
}
Fabio Cunha wrote:
Do you remember to update the main.cpp file?
Hi, I update some info in here:http://www.cocos2d-x.org/forums/6/topics/36876
Thanks
Fabio Cunha wrote:
Do you remember to update the main.cpp file?