Caused by: java.lang.ClassNotFoundException: Didn't find class "io.grpc.helloworldexample.HelloworldActivity" on path: DexPathList

FAQ:  Android app 编译好后安装到手机,运行时闪退,报如下错误:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{io.grpc.helloworldexample/io.grpc.helloworldexample.HelloworldActivity}: java.lang.ClassNotFoundException: Didn‘t find class "io.grpc.helloworldexample.HelloworldActivity" on path: DexPathList[[zip file "/data/app/io.grpc.helloworldexample-aHJfGmXKi-KoAnqDIRZHhQ==/base.apk"],nativeLibraryDirectories=[/data/app/io.grpc.helloworldexample-aHJfGmXKi-KoAnqDIRZHhQ==/lib/arm64, /system/lib64, /vendor/lib64]]

问题原因:

重复拷贝工程,并且重名工程都在as中打开过,导致as产生混淆,找不到相应类:

解决办法:

直接禁用Instant run, 这个效果最直接

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

试了下下面其他的办法,对GRPC上的这个问题解决没有效果,只能禁用即时编译,看来这个即时编译就是一个摆设,不实用,毛病问题太多!!!



其他的解决办法(供参考):

DELETE THAT FOLDER .gradle.

deleted "build" folder under "app" folder.

Change the application name in AndroidManifest to full path
Clean Project
Rebuild Project
Build APK

My problem solved using use multi dex:

android {
defaultConfig {

// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies
{
compile ‘com.android.support:multidex:1.0.0‘
}

// in AndroidManifest.xml:
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>

public class MyApplication extends MultiDexApplication

Make sure this Diable preDexLibraries

In your app module .gradle file

android {
dexOptions {
  preDexLibraries false
 }

}

分类: Android

Caused by: java.lang.ClassNotFoundException: Didn't find class "io.grpc.helloworldexample.HelloworldActivity" on path: DexPathList

原文地址:https://www.cnblogs.com/pang-blog/p/12361435.html

时间: 2024-11-05 13:40:35

Caused by: java.lang.ClassNotFoundException: Didn't find class "io.grpc.helloworldexample.HelloworldActivity" on path: DexPathList的相关文章

java.lang.ClassNotFoundException: Didn&#39;t find class &quot;stu.love.neihan.MainActivity&quot; on path: DexPathL

java.lang.ClassNotFoundException: Didn't find class "stu.love.neihan.MainActivity" on path: DexPathList  解决方案: 今天遇到一个Bug: 具体的bug 显示: 10-06 22:34:43.019: E/AndroidRuntime(10813): Caused by: java.lang.ClassNotFoundException: Didn't find class &quo

Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 19:41:17 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataPro

1.错误描写叙述 信息: MLog clients using java 1.4+ standard logging. 2014-7-12 19:29:20 com.mchange.v2.c3p0.C3P0Registry banner 信息: Initializing c3p0-0.9.2.1 [built 20-March-2013 10:47:27 +0000; debug? true; trace: 10] 2014-7-12 19:29:21 org.springframework.w

Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor

1.错误描述 Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRe

Android项目编译的时候出现:Caused by: java.lang.ClassNotFoundException: com.example.aaa.MainActivity

错误类型: 04-28 06:10:15.508: E/AndroidRuntime(849): Caused by: java.lang.ClassNotFoundException: com.example.aaa.MainActivity 04-28 06:10:15.508: E/AndroidRuntime(849): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 04-28 06:1

Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWo

1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 14:19:28 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using

maven项目出现:Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

今天安装和部署maven项目的时候一直都出现这样的错误:  maven项目出现:Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener  按照网上的好多都是说spring.jar包什么的问题,但是我这个项目修改了也没有效果的样子,后来自己尝试了一下,发现是maven的包没成功导入项目中: 在eclipse中:如果在这样:右击 Maven project -

Caused by: java.lang.ClassNotFoundException: flex.messaging.io.BeanProxy

1.错误描写叙述 2014-7-13 1:34:46 org.apache.catalina.startup.HostConfig undeploy 信息: Undeploying context [/blazeds] 2014-7-13 1:34:46 org.apache.catalina.core.ApplicationContext log 严重: Servlet MessageBrokerServlet threw unload() exception javax.servlet.Se

Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition

1.错误描述 java.lang.NoClassDefFoundError: [Lorg/hibernate/engine/FilterDefinition; at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2570) at java.lang.Class.getDeclaredMethods(Class.java:1855)