java.lang.ClassNotFoundException:在路径上找不到类:dexpathlist [英] java.lang.ClassNotFoundException: Didn't find class on path: dexpathlist

查看:43
本文介绍了java.lang.ClassNotFoundException:在路径上找不到类:dexpathlist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在处理一个必须使用纯原生 ndk 的项目.当我尝试从 Irrlicht 引擎源运行一个 helloworld 示例时,它起作用了.然后我尝试按照该示例的相同格式在我的项目中使用它.但我得到了:

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]]

在运行我的项目时.

这是我的 main.cpp 文件:

Here is my main.cpp file:

#include <android/log.h>
#include <jni.h>
#include <android_native_app_glue.h>
#include "android_tools.h"
#ifdef _IRR_ANDROID_PLATFORM_
void android_main(android_app* app)
{
__android_log_print(4 , "pom" , "nothing");
}

#endif

在 Android.mk 中:

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)

而且我在 AndroidManifest.xml 中给出了 Activity 名称:

And I have given Activity name in AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.irrlicht.example1"
    android:versionCode="1"
    android:versionName="1.0">
...
<application android:icon="@drawable/irr_icon" android:label="HelloWorldMobile1" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="true">
        <activity android:name="android.app.POMActivity"
        android:label="HelloWorldMobile1"
        android:launchMode="singleTask"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait"
        android:clearTaskOnLaunch="true">
        <meta-data android:name="android.app.lib_name" android:value="HelloWorldMobile1" />                     

我在这里做错了什么?如果需要,我会发布完整的代码.

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

推荐答案

我尝试了所有可能的选项,但结果为零.最后我找到了对我有帮助的正确解决方案.只需禁用 Instant Run 转到文件 -> 设置 -> 构建、执行、部署 -> 即时运行 -> 取消选中即时运行复选框.运行你的应用一次,这个 apk 文件就可以正常工作了..

I tried all possible options but result is zero. Finally i found correct solution which is helpful for me. Just go to disable Instant Run Go to File -> Settings -> Build,Execution, Deployment -> Instant Run -> Uncheck the checkbox for instant run. Run your app once and this apk file work properly..

这篇关于java.lang.ClassNotFoundException:在路径上找不到类:dexpathlist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆