dexpathlist.java,抛出java.lang.ClassNotFoundException:没有找到路径类:dexpathlist

I'm currently working on a project in which I have to use purely native ndk. It worked when I try running an helloworld example from Irrlicht engine source. Then I try using it in my project following the same format of that example. But I got:

03-14 01:40:05.308: E/AndroidRuntime(799): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.irrlicht.example1/android.app.POMActivity}: java.lang.ClassNotFoundException: Didn't find class "android.app.POMActivity" on path: DexPathList[[zip file "/data/app/com.irrlicht.example1-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.irrlicht.example1-2, /system/lib]]

while running my project.

Here is my main.cpp file:

#include

#include

#include

#include "android_tools.h"

#ifdef _IRR_ANDROID_PLATFORM_

void android_main(android_app* app)

{

__android_log_print(4 , "pom" , "nothing");

}

#endif

in Android.mk:

LOCAL_PATH := $(call my-dir)/..

IRRLICHT_PROJECT_PATH := $(LOCAL_PATH)

include $(CLEAR_VARS)

LOCAL_MODULE := Irrlicht

LOCAL_SRC_FILES := /home/karthik/Android/Essentials/ogl-es/lib/Android/libIrrlicht.a

include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := HelloWorldMobile1

LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ -pipe -fno-exceptions -fno-rtti -fstrict-aliasing

LOCAL_C_INCLUDES := -I ../../include -I /home/karthik/Android/Essentials/ogl-es/include -I /home/karthik/Android/json/jsoncpp-src-0.5.0/libs/linux-gcc-4.8 -I /home/karthik/Android/json/jsoncpp-src-0.5.0/include/json

LOCAL_SRC_FILES := android_tools.cpp main.cpp

LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid -ldl

LOCAL_STATIC_LIBRARIES := Irrlicht android_native_app_glue

include $(BUILD_SHARED_LIBRARY)

$(call import-module,android/native_app_glue)

And I have given Activity name in AndroidManifest.xml:

package="com.irrlicht.example1"

android:versionCode="1"

android:versionName="1.0">

...

android:label="HelloWorldMobile1"

android:launchMode="singleTask"

android:configChanges="orientation|keyboardHidden"

android:screenOrientation="portrait"

android:clearTaskOnLaunch="true">

What is the mistake I am doing here? I'll post full code if necassary.

解决方案

I had a similar problem, here's my solution:

Right click on your project and select Properties.

Select Java Build Path from the menu on the left.

Select the Order and Export tab.

From the list make sure the libraries or external jars you added to your project are checked.

Finally, clean your project & run.

You may also check this answer.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值