简体   繁体   English

“无法实例化appComponentFactory”我尝试了很多方法,但我得到了同样的错误

[英]"Unable to instantiate appComponentFactory" I tried it in many ways, but I get the same error

I keep getting an error when running the app.运行应用程序时,我不断收到错误消息。

Error content.错误内容。

E/LoadedApk: Unable to instantiate appComponentFactory
    java.lang.ClassNotFoundException: Didn't find class "com.mopius.samsung.cnt.pt2.user.whateverString" on path: DexPathList[[zip file "/data/app/com.mopius.samsung.cnt.pt2.user-DAObBSssK56o1gzvrv8Oog==/base.apk"],nativeLibraryDirectories=[/data/app/com.mopius.samsung.cnt.pt2.user-DAObBSssK56o1gzvrv8Oog==/lib/arm64, /system/lib64, /product/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.LoadedApk.createAppFactory(LoadedApk.java:273)
        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:896)
        at android.app.LoadedApk.getClassLoader(LoadedApk.java:991)
        at android.app.LoadedApk.getResources(LoadedApk.java:1248)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2618)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2610)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6900)
        at android.app.ActivityThread.access$1700(ActivityThread.java:272)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8034)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

The methods i tried我试过的方法

  1. AndroidManifest.xml Add the line AndroidManifest.xml 添加该行

    tools:replace="android:appComponentFactory" android:appComponentFactory="whateverString"工具:replace="android:appComponentFactory" android:appComponentFactory="whateverString"

  2. proguard-rules.pro Add the line proguard-rules.pro 添加行

    -keep class androidx.core.app.CoreComponentFactory{*;} -保持 class androidx.core.app.CoreComponentFactory{*;}

I've tried, but I keep getting the same error.我试过了,但我一直收到同样的错误。 Do you know how to solve it?你知道怎么解决吗?

I was getting the same error and fixed it by changing我遇到了同样的错误并通过更改来修复它
the multidex dependency from support to androidx like this:supportandroidx的 multidex 依赖关系如下:

implementation 'com.android.support:multidex:2.0.1'实施 'com.android.support:multidex:2.0.1'

implementation 'androidx.multidex:multidex:2.0.1'

Don't forget to add this in defaultConfig:不要忘记在 defaultConfig 中添加:

multiDexEnabled true

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试了一切仍然出现错误:无法实例化 appComponentFactory java.lang.ClassNotFoundException - Tried everything still getting error: Unable to instantiate appComponentFactory java.lang.ClassNotFoundException 我尝试了所有可能的方法使用Webdriver来定位元素,但收到错误消息“无法定位元素” - I have tried all possible ways to locate an element using Webdriver, but getting an error “Unable to locate Element” 你好。 我是 android 应用程序开发的新手。 我尝试创建一个简单的计数器,但在构建后出现错误“无法实例化活动” - Hi! I am new to android app development. I tried to create a simple counter but after build getting error “Unable to instantiate activity” 无法在网站上找到元素,我尝试了所有定位器,但出现错误“没有这样的元素”。 我是自动化的自学初学者 - Unable to locate elements on a website , i tried all the locators but I get the error "No such element" . I am a self taught beginner to Automation 如果我尝试手动实例化 spring bean 会发生什么 - What will happen if I tried to instantiate spring bean manually 今天在Java中的日期 - 我已经尝试了常规方法 - Getting today's date in java - I've tried the regular ways 使用Google Maps Android Marker Clustering Utility时无法实例化appComponentFactory - Unable to instantiate appComponentFactory when using Google Maps Android Marker Clustering Utility 我试图在Java中建立Google BigQuery的连接,并收到以下错误? - I tried to make connection for Google BigQuery in java, and get following error? 我试图制作 ListView 并从字符串中获取数据,但出现此错误 - I tried to make ListView and get the data from string, but got this error 抛出错误。 我怎样才能解决这个问题? 我尝试了很多事情,但是我是新手,逻辑超出了我的范围 - Throw error. How can I fix this? I've tried many things, but I am new to it and the logic is a little beyond me
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM