我想從android工作室在我的android手機上運行365瀏覽器應用程序。我想看看瀏覽器應用程序是如何配置的,所以我克隆了來自github的365瀏覽器應用程序,並試圖在android studio中運行它。但我得到致命異常:瀏覽器應用程序 - 關閉 - 致命異常
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;
謝謝!
感謝您的回覆。我在項目文件夾中搜索了BaseChromiumApplication.java,但沒有找到具有該名稱的任何文件。 – RDPD
我得到的唯一結果是ChromeFullScreenManager.java文件,它有兩個代碼行,我只是將其添加到我的問題描述中。 – RDPD
也許BaseChromiumApplication.java可以存儲在JAR或AAR中。但坦率地說,我對Android編程知之甚少。 – fastman92