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 解决办法: 只 ...
随机推荐
- python3+selenium入门13-操作cookie
可以把cookie理解为自己账户的身份证.因为http协议是无状态的,上一个请求和下一个请求没有关系.但是有时需要有关联.比如登录之后,才能进行操作这样的设置.这个就是cookie在起作用.登录成功时 ...
- NOIP模拟赛10 题解
t3: 题意 给你一棵树,然后每次两种操作:1.给一个节点染色 : 2. 查询一个节点与任意已染色节点 lca 的权值的最大值 分析 考虑一个节点被染色后的影响:令它的所有祖先节点(包括自身)的所有除 ...
- 阿里服务器配置swap
说明:阿里服务器安装系统之后,默认swap为0 .该篇是阿里服务器上配置swap 的过程记录: 1.进入目录 cd /var/ 2.获取要增加的SWAP文件块(这里以1GB为例,count = 102 ...
- UVA 1395 MST
给你一个图, 求一个生成树, 边权Max – Min 要最小,输出最小值, 不能构成生成树的 输出 -1: 思路: Keuksal 算法, 先排序边, 然后枚举 第一条边, 往后加入边, 直到有 n- ...
- 基于centos7下appium环境搭建
事件背景: 前几日在群里看到关总说他的server端是搭建在linux环境下,包括对客户端与服务端的交互处理,感觉整体思路清晰可鉴,于是就想尝试,动手实践,接着从环境搭建开始搞起,于是就有了这篇文章, ...
- Python学习-字符编码浅析
1.什么是字符编码 既然是简述那肯定是简单明了.字符编码,看名字就是一种字符的编码格式,由于计算机内部采用二进制,想要将人类的语言字符输入到计算机就需要一种编码格式,这就是字符编码.字符------- ...
- centos6.5 Python.7 pip install PIL --allow-external PIL --allow-unverified PIL报错 no such option: --allow-external
解决办法 pip install pillow 使用from PIL import Image ,正常!!
- grep匹配某个次出现的次数
cat file | grep -c 'xxx' 统计xxx在file中出现的行数 cat file | grep -o 'xxx' 统计xxx在file中出现的次数
- AD9361寄存器配置顺序,循环模式,自收自发
:] cmd_data; :] index; begin case(index) 'h000,8'h00};//set spi -- 'h3df,8'h01};//set init -- 'h037, ...
- D3.js 使用缩放zoom时节点无法拖动,只能整体移动的问题
.on("dragstart", function() { d3.event.sourceEvent.stopPropagation(); }) https://stackover ...