Before today i use Eclipse 3.8 with Sequoyah plugin for Android NDK project.
But today i decide to freshen Eclipse to Juno release with SDK and NDK.
I was very happy then i see Android Native Tools in ADT installation, which will do the same job like Sequoyah, but with debug feature.
I created new Android Project to test it.
Adding Android Native Support create jni folder with Android.mk, .cpp file, well same that Sequayah do.
Then i get first unresolved to jni.h. I get similar bug with Sequoyah, so i rebuild index and restart Eclipse. After restart it not disappeared.
I go to Paths And Symbols at C/C++ properties.
But there are all that needed built-in includes.
(NDK PATH)/platforms/android-8/arch-arm/usr/include - there are jni.h, log.h etc.
I tryed to add extra dublicate includes to jni.h, clean project, restart, rebuild index, change .ccp to .c, it stays unresolved. I got no errors in error log, but syntax errors in editor on jni functions.
NativeLib.java
package com.aristarhys.glow;
public class NativeLib
{
private static final String NATIVE_LIB = "glow";
static
{
System.loadLibrary(NATIVE_LIB);
}
private NativeLib(){};
public static native void test();
}
glow.h
#ifndef GLOW_H_
#define GLOW_H_
#include <jni.h> //unresolved
//syntax error
JNIEXPORT void JNICALL Java_com_aristarhys_glow_NativeLib_test(JNIEnv* env, jclass cls);
#endif /* GLOW_H_ */
log.h
#ifndef LOG_H_
#define LOG_H_
#include <android/log.h> //unresolved
#define INFO_TAG "[INFO]"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, INFO_TAG, __VA_ARGS__)
#endif /* LOG_H_ */
glow.c
#include "glow.h"
#include "log.h"
//syntax error
JNIEXPORT void JNICALL Java_com_aristarhys_glow_NativeLib_test(JNIEnv* env, jclass cls)
{
LOGI("HI");
}
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := glow
LOCAL_SRC_FILES := glow.c
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)