浏览器应用程序 - 正在关闭 - 致命异常
Browser app - Shutting Down - Fatal Exception
我正在尝试 运行 在我的 android phone 上 android 工作室的 365 浏览器应用程序。我想看看浏览器应用程序是如何配置的,所以我从 github 克隆了 365 浏览器应用程序,并尝试在 android 工作室中 运行 它。但是我得到了致命的异常:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mogoweb, PID: 18192
java.lang.RuntimeException: Unable to get provider org.chromium.chrome.browser.ChromeBrowserProvider: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at org.chromium.base.BaseChromiumApplication.initCommandLine(BaseChromiumApplication.java:116)
at org.chromium.chrome.browser.ChromeBrowserProvider.onCreate(ChromeBrowserProvider.java:268)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
I/Process: Sending signal. PID: 18192 SIG: 9
Application terminated.
我不确定代码或设置的哪一部分导致了这个问题。谁能告诉我错误的哪一部分实际上与问题有关以及如何解决它?
当我在项目文件夹中搜索 BaseChromiumApplication.java 时,我得到了 ChromeFullScreenManager.java 结果 java 文件包含以下行:
import org.chromium.base.BaseChromiumApplication;
import org.chromium.base.BaseChromiumApplication.WindowFocusChangedListener;
谢谢!
Caused by: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at org.chromium.base.BaseChromiumApplication.initCommandLine(BaseChromiumApplication.java:116)
at org.chromium.chrome.browser.ChromeBrowserProvider.onCreate(ChromeBrowserProvider.java:268)
参见 BaseChromiumApplication.java
中的第 116 行
变量,com.android.tools.fd.runtime.BootstrapApplication 类型的对象无法转换为 org.chromium.base.BaseChromiumApplication。
类型无关。要使转换成功,对象类型必须是从您要将其转换成的类型创建的,或者必须至少从该类型派生,如下所示:
对象
Class_A,派生自对象
Class_B,源自 Class_A
Class_C,源自 Class_B
如果创建了一个 Class_C 类型的对象,它可以在以后完美地转换为 Class_A、Class_B、Class_C 或 Object 类型的对象。
我正在尝试 运行 在我的 android phone 上 android 工作室的 365 浏览器应用程序。我想看看浏览器应用程序是如何配置的,所以我从 github 克隆了 365 浏览器应用程序,并尝试在 android 工作室中 运行 它。但是我得到了致命的异常:
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mogoweb, PID: 18192
java.lang.RuntimeException: Unable to get provider org.chromium.chrome.browser.ChromeBrowserProvider: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at android.app.ActivityThread.installProvider(ActivityThread.java:5177)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at org.chromium.base.BaseChromiumApplication.initCommandLine(BaseChromiumApplication.java:116)
at org.chromium.chrome.browser.ChromeBrowserProvider.onCreate(ChromeBrowserProvider.java:268)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
at android.app.ActivityThread.installProvider(ActivityThread.java:5174)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4769)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4709)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
I/Process: Sending signal. PID: 18192 SIG: 9
Application terminated.
我不确定代码或设置的哪一部分导致了这个问题。谁能告诉我错误的哪一部分实际上与问题有关以及如何解决它?
当我在项目文件夹中搜索 BaseChromiumApplication.java 时,我得到了 ChromeFullScreenManager.java 结果 java 文件包含以下行:
import org.chromium.base.BaseChromiumApplication;
import org.chromium.base.BaseChromiumApplication.WindowFocusChangedListener;
谢谢!
Caused by: java.lang.ClassCastException: com.android.tools.fd.runtime.BootstrapApplication cannot be cast to org.chromium.base.BaseChromiumApplication
at org.chromium.base.BaseChromiumApplication.initCommandLine(BaseChromiumApplication.java:116)
at org.chromium.chrome.browser.ChromeBrowserProvider.onCreate(ChromeBrowserProvider.java:268)
参见 BaseChromiumApplication.java
中的第 116 行变量,com.android.tools.fd.runtime.BootstrapApplication 类型的对象无法转换为 org.chromium.base.BaseChromiumApplication。 类型无关。要使转换成功,对象类型必须是从您要将其转换成的类型创建的,或者必须至少从该类型派生,如下所示:
对象
Class_A,派生自对象
Class_B,源自 Class_A
Class_C,源自 Class_B
如果创建了一个 Class_C 类型的对象,它可以在以后完美地转换为 Class_A、Class_B、Class_C 或 Object 类型的对象。