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
}
}
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.grpc.helloworldexample.HelloworldActivity" on path: DexPathList的更多相关文章
- 项目报错:Caused by: java.lang.ClassNotFoundException: Didn't find class "..."on path: DexPathList
项目报错: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.eshore.njb.MyApplicat ...
- 【异常】Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException
Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException ...
- android 自定义View Caused by: java.lang.ClassNotFoundException: Didn't find class
在android studio中, 自定义View 时,出现 Caused by: java.lang.ClassNotFoundException: Didn't find class 在查看包名和 ...
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
1.错误叙述性说明 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/web ...
- Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC
Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC 缺少com/sun/tools/inte ...
- Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
1.错误原因 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...
- Caused by: java.lang.ClassNotFoundException: com.mchange.v2.c3p0.ComboPooledDataSource
1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -he ...
- 生成HFile文件后倒入数据出现Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.filter.Filter
数据导入的时候出现: at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclar ...
- Selenium 出现: Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
webDriver 运行的时候出现: Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal 解决办法: 只 ...
随机推荐
- MySQL软件基本管理
1. 忘记密码 windows平台下,5.6.43版本mysql # 关闭mysql # 在cmd中执行:mysqld --skip-grant-tables # 在cmd中执行:mysql # 执行 ...
- Linux DTS(Device Tree Source)设备树详解之二(dts匹配及发挥作用的流程篇)【转】
转自:https://blog.csdn.net/radianceblau/article/details/74722395 版权声明:本文为博主原创文章,未经博主允许不得转载.如本文对您有帮助,欢迎 ...
- Ubuntu的内核转储工具【转】
转自:http://www.cnblogs.com/wwang/archive/2010/11/19/1881304.html 在我的上一篇博文<Linux内核的Oops>的最后介绍到一个 ...
- 利用Linux系统生成随机密码的10种方法【转】
Linux操作系统的一大优点是对于同样一件事情,你可以使用高达数百种方法来实现它.例如,你可以通过数十种方法来生成随机密码.本文将介绍生成随机密码的十种方法. 1. 使用SHA算法来加密日期,并输出结 ...
- requests库入门12-文件上传和下载
因为找不到可以演示上传接口,所以只能纯代码了 文件上传 上传文件是在请求中使用files参数,files需要指向一个dict,然后dict里面的键是接口中对应文件名的字段,而值就是打开这个文件读取到内 ...
- C# string.join
String.Join 方法 平常工作中经常用到string.join()方法,在vs 2017用的运行时(System.Runtime, Version=4.2.0.0)中,共有九个(重载)方法. ...
- python用类装饰函数的一个有趣实现
class RunningLog: def __init__(self,func): self._func=func self._func_name = func.__name__ def __cal ...
- Web.config设置system.webServer
一般情况在iis部署web网站都非常顺利,但是遇到复杂环境,或者被配置过又正在使用的时候,就束手无策了, 因为对IIS和Web.config不熟悉,不知其中要害,导致浪费一天甚至更久的时间去处理一个可 ...
- HomeBrew 安转beta版软件
今天想装测试版的cocoapods,用 brew install cocoapods 后,总是安装稳定版,就是1.1.0,不是最新的beta版,发现用下面这个命令可以装最新beta版 brew ins ...
- Linux IO实时监控iostat命令
简介 iostat主要用于监控系统设备的IO负载情况,iostat首次运行时显示自系统启动开始的各项统计信息,之后运行iostat将显示自上次运行该命令以后的统计信息.用户可以通过指定统计的次数和时间 ...