zoukankan      html  css  js  c++  java
  • 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
     }

    }

  • 相关阅读:
    织梦DedeCms网站首页不生成html文件动态显示方法
    PHP7.0下安装DEDE织梦 出现 GD不支持的解决方法
    DEDECMS5.7支持伪静态的方法
    DEDECMS全站伪静态设置方法
    设置 SSH 通过密钥登录
    Windows安装OpenSSH服务
    VS Code远程开发工具错误-找不到SSH安装
    帝国CMS自定义列表的排序
    帝国CMS灵动标签e:loop的使用方法
    cisco 3750交换机堆叠后配置恢复方法
  • 原文地址:https://www.cnblogs.com/bluestorm/p/10348265.html
Copyright © 2011-2022 走看看