Flutter- Since adding Cloud Messaging Android app crashes - firebase

Ever since I added cloud messaging to my Flutter app, the app crashes on load.
It works fine on iOS.
As far as I can tell its all set up properly, and the fact that It works on iOS I am at a loss..
This is the logcat file
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/internal/InternalTokenProvider;
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at com.google.firebase.components.ComponentDiscovery.instantiate(com.google.firebase:firebase-common##17.0.0:78)
at com.google.firebase.components.ComponentDiscovery.discover(com.google.firebase:firebase-common##17.0.0:71)
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common##17.0.0:468)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:354)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:321)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##17.0.0:305)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##17.0.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##17.0.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5853)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
2019-06-05 13:02:06.390 7346-7346/? E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.internal.InternalTokenProvider" on path: DexPathList[[zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/base.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_dependencies_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_0_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_1_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_2_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_3_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_4_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_5_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_6_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_7_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_8_apk.apk", zip file "/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/base.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_dependencies_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_0_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_1_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_2_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_3_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_4_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_5_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_6_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_7_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_8_apk.apk!/lib/x86, /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_slice_9_apk.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 24 more
Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.heartchurch.heartland-M4kZV3m1AevnHc2GxsBI5A==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:354)
at dalvik.system.DexFile.<init>(DexFile.java:101)
at dalvik.system.DexFile.<init>(DexFile.java:75)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
at dalvik.system.DexPathList.<init>(DexPathList.java:164)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
2019-06-05 13:02:06.391 7346-7346/? E/AndroidRuntime: at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
at android.app.LoadedApk.getResources(LoadedApk.java:1032)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5749)
... 8 more
I have made sure the following is added to my manifest
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Open the android project.
Go the build.gradle of firebase_messaging
In the dependencies change api 'com.google.firebase:firebase-messaging:18.0.0' to
api 'com.google.firebase:firebase-messaging:17.3.3'
Make sure you are using the latest version of all the cloud dependencies in pubspec.yaml
This solution worked for me

Related

unity Firebase reports are not printed

After upgrading unity version from 2019 to 2020
Crash intermittently when switching scenes.
So I tried to view the backtrace through firebase crashlytics, but I can't see the backtrace with the error below.
2022-03-11 16:58:10.102 21274-21274/? E/AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.myapp/lib/arm/libcrashlytics-handler.so" has unexpected e_machine: 40
at com.google.firebase.crashlytics.ndk.CrashpadMain.main(CrashpadMain.java:31)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.myapp/lib/arm/libcrashlytics-handler.so" has unexpected e_machine: 40
at java.lang.Runtime.load0(Runtime.java:908)
at java.lang.System.load(System.java:1537)
at com.google.firebase.crashlytics.ndk.CrashpadMain.main(CrashpadMain.java:29)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) 
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:301) 
2022-03-11 16:58:10.107 21274-21274/? E/AndroidRuntime: Error reporting crash
java.lang.RuntimeException: Bad file descriptor
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.os.ServiceManagerProxy.getService(ServiceManagerNative.java:123)
at android.os.ServiceManager.getService(ServiceManager.java:55)
at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:3049)
at android.app.ActivityManagerNative$1.create(ActivityManagerNative.java:3048)
at android.util.Singleton.get(Singleton.java:34)
at android.app.ActivityManagerNative.getDefault(ActivityManagerNative.java:86)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:123)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
First of all, I checked that "libcrashlytics-handler.so" is in that location and it is there.
And I tried to upgrade the version of the sdk to the latest version of 8.8.0, but it was not resolved.
Does anyone know about this issue? I need your help.
unity version : 2020.3.29f
firebase sdk : 8.8.0
android : 7.1.2(Emulator)

Crash when using bundled ttf font on Android 10 / Android Q

After I updated the target level for my Android app from 28 to 29 (Android 10) the app crashes on a Pixel 3 (with Android 10).
Versions used
Android Gradle Plugin 3.5.0
Gradle 5.5.1
Question: Is this a known issue?
Details
The crash happens on various layouts using different tags (TextView, androidx.appcompat.widget.AppCompatTextView, etc)
I use the attribute "android:fontFamily" and reference a font bundled in one of my external libraries.
The font file, opensans_regular.ttf, is placed in res\font
Stacktrace below.
For security reasons I've replaced the apps package names with x.y.z.
2019-09-05 14:23:43.530 9060-9060/x.y.z E/AndroidRuntime: FATAL EXCEPTION: main
Process: x.y.z, PID: 9060
java.lang.RuntimeException: Unable to resume activity {x.y.z/x.y.main.devicefinder.BleFindActivity}: android.view.InflateException: Binary XML file line #73 in x.y.z:layout/fragment_add_devices: Binary XML file line #73 in x.y.z:layout/fragment_add_devices: Error inflating class TextView
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4205)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4237)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #73 in x.y.z:layout/fragment_add_devices: Binary XML file line #73 in x.y.z:layout/fragment_add_devices: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #73 in x.y.z:layout/fragment_add_devices: Error inflating class TextView
Caused by: java.lang.IndexOutOfBoundsException: index=0 out of bounds (limit=0, nb=4)
at java.nio.Buffer.checkIndex(Buffer.java:564)
at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:570)
at android.graphics.fonts.FontFileUtil.analyzeStyle(FontFileUtil.java:94)
at android.graphics.fonts.Font$Builder.build(Font.java:364)
at android.graphics.Typeface$Builder.build(Typeface.java:596)
at android.content.res.ResourcesImpl.loadFont(ResourcesImpl.java:980)
at android.content.res.Resources.getFont(Resources.java:400)
at android.content.res.TypedArray.getFont(TypedArray.java:1035)
at android.widget.TextView.readTextAppearance(TextView.java:3991)
at android.widget.TextView.<init>(TextView.java:1064)
at android.widget.TextView.<init>(TextView.java:968)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:87)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:83)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:177)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:102)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:242)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1061)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at x.y.main.devicefinder.BleFindFragment.onCreateView(BleFindFragment.java:62)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2439)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
2019-09-05 14:23:43.531 9060-9060/x.y.z E/AndroidRuntime: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:802)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3273)
at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3241)
at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:223)
at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:538)
at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:527)
at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172)
at android.app.Activity.performResume(Activity.java:7964)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4195)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4237)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Update 1: I copied the font from the library module and included in the app res folder but still have this issue. So I changed the title to made this question more generic.
Update 2: When using a .otf font it works
I've now reported this to Google: https://issuetracker.google.com/issues/140546806
So it now became a known issue I suppose :-)
Update
The root cause: My ttf file was empty(!). I never noticed as older Androids would silently ignore this.
Already Setting the same font as the existing font throws an Exception with this message
java.lang.IllegalArgumentException: Font {path=null, style=FontStyle { weight=400, slant=0}, ttcIndex=0, axes=, localeList=, buffer=java.nio.DirectByteBuffer[pos=0 lim=170012 cap=170012]} has already been added
Maybe this will help someone who comes here looking for this error
Replace your existing fonts with other supporting fonts.

com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into x folder

Recently migrated to JxBrowser 7.0 and i have the following error coming every time i try to start the application .
com.teamdev.jxbrowser.internal.ChromiumExtractorException: Failed to extract Chromium binaries into C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0
at jxbrowser#7.0/com.teamdev.jxbrowser.internal.ChromiumExtractor.extract(ChromiumExtractor.java:45)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.extractChromiumBinaries(EngineImpl.java:386)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.internal.EngineImpl.newInstance(EngineImpl.java:156)
at jxbrowser#7.0/com.teamdev.jxbrowser.engine.Engine.newInstance(Engine.java:96)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.initialize(WebBrowserTabController.java:191)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserTabController.<init>(WebBrowserTabController.java:166)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createNewTab(WebBrowserController.java:180)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.createAndAddNewTab(WebBrowserController.java:161)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.initialize(WebBrowserController.java:116)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2591)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
at XR3Player/com.goxr3plus.xr3player.controllers.chromium.WebBrowserController.<init>(WebBrowserController.java:99)
at XR3Player/com.goxr3plus.xr3player.application.MainLoader.lambda$startPart2$8(MainLoader.java:373)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:835)
It says caused by :
Caused by: java.io.FileNotFoundException: chromium-win64.7z, chromium-win32.7z
... 44 more
where is this coming from ? My project is a Maven project and i have added all the needed dependencies and on the start of application i have added the license key and the directory i want to browser to have it's files :
static {
// Chromium Extract Location Dir
System.setProperty("jxbrowser.license.key", "license_key");
System.setProperty("jxbrowser.chromium.dir",
DatabaseTool.getAbsoluteDatabaseParentFolderPathWithSeparator() + "Chrome" + "7.0");
}
Enabling JxBrowser Logger :
01:19:49.837 DEBUG Verifying Chromium binaries...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll...
01:19:49.838 DEBUG Verifying C:\Personal Projects\Github\XR3Player\target\classes\Chrome7.0\libEGL.dll... [FAIL] File does not exist
01:19:49.839 DEBUG Verifying Chromium binaries... [FAIL]
01:19:49.839 DEBUG Finding Chromium binaries in JARs...
01:19:49.839 DEBUG Finding WIN_64...
01:19:49.840 DEBUG Finding WIN_64... [FAIL]
01:19:49.840 DEBUG Finding WIN_32...
01:19:49.840 DEBUG Finding WIN_32... [FAIL]
Maven Dependencies :
<!-- CHROMIUM BROWSER -->
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-win64</artifactId>
<version>7.0</version>
</dependency>
<dependency>
<groupId>com.teamdev.jxbrowser</groupId>
<artifactId>jxbrowser-javafx</artifactId>
<version>7.0</version>
</dependency>
I believe this happens when you set up the project in an IDE and add the jxbrowser dependencies as libraries. For me, intellij did not recognize the os specific chromium jar as a valid jar directory. It did not place this jar in the classpath.
In my case, the resource not found was -
jxbrowser-linux64-7.5.jar
This jar contains - chromium-*.7z which is needed by jxbrowser.
I extracted and unzipped this file to an accessible location.
The location for the chromium installation should then be provided to the engine-
Engine engine = Engine.newInstance(
EngineOptions.newBuilder(HARDWARE_ACCELERATED)
.chromiumDir(Paths.get("/home/rgupta/.jxbrowser/chromium/chromium-linux64"))
.build());
Then, jxbrowser started working.
I had the same bug when i added the OS specific jar in Intellij classpath. What i have done to fix it is to remove it and put it back again. Intellij don't recognize it and display a popup with options to select what kind of jar it is. then select classes.

How do I deobfuscate Proguard in Firebase Crashlytics

I am trying to integrate Firebase Crashlytics into my current project in Android Studio 3.1.4. The first time I forced a FirebaseCrash.report, I got this in my logcat:
08-10 07:25:25.114 16661-16718/com.example.android.twlistsales E/FirebaseCrash: Failed to initialize crash reporting
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzcaq;
at java.util.concurrent.FutureTask.report(FutureTask.java:123)
at java.util.concurrent.FutureTask.get(FutureTask.java:207)
at com.google.firebase.crash.zze.run(Unknown Source:6)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzcaq;
at com.google.android.gms.internal.zzdzp.<clinit>(Unknown Source:8)
at com.google.android.gms.internal.zzdzp.initialize(Unknown Source:0)
at com.google.firebase.crash.zzc.zzbsq(Unknown Source:2)
at com.google.firebase.crash.zzd.call(Unknown Source:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzcaq" on path: DexPathList[[zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/base.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_resources_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.android.gms.internal.zzdzp.<clinit>(Unknown Source:8) 
at com.google.android.gms.internal.zzdzp.initialize(Unknown Source:0) 
at com.google.firebase.crash.zzc.zzbsq(Unknown Source:2) 
at com.google.firebase.crash.zzd.call(Unknown Source:2) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
at java.lang.Thread.run(Thread.java:764) 
Suppressed: java.io.IOException: No original dex files found for dex location (arm64) /data/app/com.example.android.twlistsales-fs1zdAnDopYdjq5hyiS8pw==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:678)
Then this:
08-10 07:25:25.115 16661-16718/com.example.android.twlistsales E/FirebaseCrash: at android.app.LoadedApk.getClassLoader(LoadedApk.java:711)
at android.app.LoadedApk.getResources(LoadedApk.java:944)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2303)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5943)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Then this:
08-10 07:25:25.117 16661-16719/com.example.android.twlistsales E/FirebaseCrash: Failed waiting for crash api to load.
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1063)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1352)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
at com.google.firebase.crash.FirebaseCrash.zzbsk(Unknown Source:6)
at com.google.firebase.crash.FirebaseCrash.zza(Unknown Source:0)
at com.google.firebase.crash.zza.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
And finally this, which is the error that I forced:
08-10 07:25:25.907 16661-16722/com.example.android.twlistsales E/**ListSales - GetSales - doInBackground(): Attempt to get sales data from database failed due to JSON Exception
org.json.JSONException: Value Foo<br of type java.lang.String cannot be converted to JSONArray
at org.json.JSON.typeMismatch(JSON.java:111)
at org.json.JSONArray.<init>(JSONArray.java:96)
at org.json.JSONArray.<init>(JSONArray.java:108)
at com.example.android.twlistsales.ListSales$GetSales.doInBackground(ListSales.java:604)
at com.example.android.twlistsales.ListSales$GetSales.doInBackground(ListSales.java:555)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Does anyone know what is happening here? I'm new to Firebase and don't know my way around.
I'm guessing the problem relates to the instructions that I see when I click on Tools/Firebase/Crash Reporting, specifically step 5. It tells me to deobfuscate Proguard by adding this to my gradle files.
debug {
minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
The problem is that it doesn't tell me WHICH gradle file or WHERE in that file to put this code. Can someone enlighten me? Also, how could I send a request to the Android Studio people to kindly clarify these instructions so the next person along doesn't have the exact same problem?
I'm new to both Android Studio and Gradle so the correct place to put this code is not remotely obvious to me the way it might be to a developer more experienced in this environment. I'm guessing it goes into the app-level Gradle.build but I'm not sure if it's within the android{} group of parameters or whether it is between android{} and dependecies{}. I could spend hours figuring this out by trial and error....
Assumuning you want to obfuscate your code only in the release verion of your app (which is the most common case), the lines
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
should be included in
android{
buildTypes {
release {
<here>
}
}
}
inside your app's level build.gradle file.
However, by looking at your stack trace, it seems that you have a missing dependency problem you should take care of before obfuscating your code (which is optional, especially if you're not much experienced).

Issues running CAMEL JAR file built in windows using Eclipse when run in Linux command line using JAVA or MVN command

I have built a Camel project in Eclipse with Maven dependencies.
It ran successfully and also Built the Jar file and ran it from the command prompt
which is running as required. But when I moved the JAR file onto to our Linux machine
which is like a Job Manager server and when I try to run the JAR file as below
I am getting the below error message.
When I try to run with the below command
$ java –jar mycamelproject
I am getting the below error, but I do have the below mentioned dependency in the Dependency-Jars folder.
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.support
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
Then I tried running with the below command.
$ mvn -X exec:java -Dexec.mainClass=mycamelpackage.mycamelmainclass
I am getting a series of the below errors such as below
[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/home/ec2-user/.m2/repository)
[DEBUG] Skipped remote update check for org.codehaus.mojo/maven-metadata.xml, already updated during this session.
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from
http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2): proxy.host.net
[ERROR] No plugin found for prefix 'exec' in the current project
and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo]
available from the repositories
How should java –jar mycamelproject work if no classpath is set? And mycamelproject should be a JAR file anyway (and if it is, you should add the *.jar extension).
Beside that, I guess your local Maven repository may be corrupt. That's usually the reason why you see the resolution will not be reattempted error message. The easiest way to fix this is to remove the corrupt directories and start Maven again.

Resources