Conflicting HERE sdk and Fresco library - android

I've just stumbled upon a very particular issue. There seem to be a conflict between some native libraries (i assume). When using the HERE premium SDK for android and Facebook's Fresco library in the same project will result in HERE map not rendering. As soon as i remove the Fresco library from my project it behaves and renders as it should.
Of course the simplest solution is not to use Fresco but i rather not do that.
Anyone any idea what is going on or how to solve this?
This is the error it throws:
org.xml.sax.SAXParseException: Unexpected end of document
at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:125)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107)
at com.nokia.maps.fh.a(XmlToDocParser.java:24)
at com.nokia.maps.ResourceManager.a(ResourceManager.java:212)
at com.nokia.maps.ResourceManager.a(ResourceManager.java:138)
at com.nokia.maps.as.<init>(GLConfigHelper.java:38)
at com.nokia.maps.y.a(BaseTextureView.java:61)
at com.nokia.maps.y.<init>(BaseTextureView.java:54)
at com.nokia.maps.bx.<init>(MapTextureView.java:36)
at com.here.android.mpa.mapping.MapView.a(MapView.java:320)
at com.here.android.mpa.mapping.MapView.<init>(MapView.java:169)
at com.nokia.maps.bk.a(MapFragmentImpl.java:143)
at com.here.android.mpa.mapping.MapFragment.onCreateView(MapFragment.java:147)
at android.app.Fragment.performCreateView(Fragment.java:2114)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:875)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1060)
at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:1162)
at android.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2131)
at android.app.Activity.onCreateView(Activity.java:5751)
at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:34)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:78)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:740)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
at com.justpark.ondemand.ui.activity.BaseActivity.setContentView(BaseActivity.java:20)
at com.justpark.ondemand.ui.activity.TurnByTurnActivity.onCreate(TurnByTurnActivity.java:145)
at android.app.Activity.performCreate(Activity.java:6500)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Seems Fresco has a file called eglconfig.xml, that file must also be present in fresco resources or in your app? If you delete this xml file from the resource tree, does it help?
/I'm from the HERESDK team and thanks for the feedback!

Related

PackageManager$NameNotFoundException for rxAndroidBle

For version 1.12.1, I am getting a runtime exception after upgrading to this version from 1.10.5
2021-07-16 15:30:16.588 22665-22665/co.(appname).staging E/AndroidRuntime: FATAL EXCEPTION: main
Process: co.(appname).staging:svc, PID: 22665
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/jakewharton/rxrelay2/BehaviorRelay;
at com.polidea.rxandroidble2.internal.DeviceModule.provideConnectionStateRelay(DeviceModule.java:57)
at com.polidea.rxandroidble2.internal.DeviceModule_ProvideConnectionStateRelayFactory.get(DeviceModule_ProvideConnectionStateRelayFactory.java:17)
at com.polidea.rxandroidble2.internal.DeviceModule_ProvideConnectionStateRelayFactory.get(DeviceModule_ProvideConnectionStateRelayFactory.java:9)
at bleshadow.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.polidea.rxandroidble2.internal.RxBleDeviceImpl_Factory.get(RxBleDeviceImpl_Factory.java:31)
at com.polidea.rxandroidble2.internal.RxBleDeviceImpl_Factory.get(RxBleDeviceImpl_Factory.java:11)
at bleshadow.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.polidea.rxandroidble2.DaggerClientComponent$DeviceComponentImpl.provideDevice(DaggerClientComponent.java:509)
at com.polidea.rxandroidble2.internal.RxBleDeviceProvider.getBleDevice(RxBleDeviceProvider.java:43)
at com.polidea.rxandroidble2.internal.scan.InternalToExternalScanResultConverter.apply(InternalToExternalScanResultConverter.java:26)
at com.polidea.rxandroidble2.internal.scan.InternalToExternalScanResultConverter.apply(InternalToExternalScanResultConverter.java:13)
at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:57)
at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60)
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66)
at com.polidea.rxandroidble2.internal.serialization.FIFORunnableEntry$1$1.onNext(FIFORunnableEntry.java:68)
at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60)
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66)
at com.polidea.rxandroidble2.internal.operations.ScanOperationApi21$1.onScanResult(ScanOperationApi21.java:83)
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:492)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jakewharton.rxrelay2.BehaviorRelay" on path: DexPathList[[zip file "/data/app/~~azBMNu86abFT1X-EHOpB2A==/co.(appname).staging-eYQb5VbY1nmgyq2oa0oeWA==/base.apk"],nativeLibraryDirectories=[/data/app/~~azBMNu86abFT1X-EHOpB2A==/co.(appname).staging-eYQb5VbY1nmgyq2oa0oeWA==/lib/arm64, /data/app/~~azBMNu86abFT1X-EHOpB2A==/co.(appname).staging-eYQb5VbY1nmgyq2oa0oeWA==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.polidea.rxandroidble2.internal.DeviceModule.provideConnectionStateRelay(DeviceModule.java:57) 
at com.polidea.rxandroidble2.internal.DeviceModule_ProvideConnectionStateRelayFactory.get(DeviceModule_ProvideConnectionStateRelayFactory.java:17) 
at com.polidea.rxandroidble2.internal.DeviceModule_ProvideConnectionStateRelayFactory.get(DeviceModule_ProvideConnectionStateRelayFactory.java:9) 
at bleshadow.dagger.internal.DoubleCheck.get(DoubleCheck.java:47) 
at com.polidea.rxandroidble2.internal.RxBleDeviceImpl_Factory.get(RxBleDeviceImpl_Factory.java:31) 
at com.polidea.rxandroidble2.internal.RxBleDeviceImpl_Factory.get(RxBleDeviceImpl_Factory.java:11) 
at bleshadow.dagger.internal.DoubleCheck.get(DoubleCheck.java:47) 
at com.polidea.rxandroidble2.DaggerClientComponent$DeviceComponentImpl.provideDevice(DaggerClientComponent.java:509) 
at com.polidea.rxandroidble2.internal.RxBleDeviceProvider.getBleDevice(RxBleDeviceProvider.java:43) 
at com.polidea.rxandroidble2.internal.scan.InternalToExternalScanResultConverter.apply(InternalToExternalScanResultConverter.java:26) 
at com.polidea.rxandroidble2.internal.scan.InternalToExternalScanResultConverter.apply(InternalToExternalScanResultConverter.java:13) 
at io.reactivex.internal.operators.observable.ObservableMap$MapObserver.onNext(ObservableMap.java:57) 
at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60) 
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66) 
at com.polidea.rxandroidble2.internal.serialization.FIFORunnableEntry$1$1.onNext(FIFORunnableEntry.java:68) 
at io.reactivex.internal.operators.observable.ObservableUnsubscribeOn$UnsubscribeObserver.onNext(ObservableUnsubscribeOn.java:60) 
at io.reactivex.internal.operators.observable.ObservableCreate$CreateEmitter.onNext(ObservableCreate.java:66) 
at com.polidea.rxandroidble2.internal.operations.ScanOperationApi21$1.onScanResult(ScanOperationApi21.java:83) 
at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper$1.run(BluetoothLeScanner.java:492) 
at android.os.Handler.handleCallback(Handler.java:938) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:223) 
at android.app.ActivityThread.main(ActivityThread.java:7664) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
The catch? I have forked the repo, made a couple very small changes (like small changes to timeouts for example), and created a build with Jitpack. I checked their Jitpack build log (https://jitpack.io/com/github/polidea/RxAndroidBle/release-1.12.1-rxjava2/build.log) against my own, and they are almost identical. I see the missing errors, I have the exact same ones. The difference is that if I use the official polidea rxAndroidBle gradle thing (which I believe is pulled from Jitpack), I do not get the same runtime issue.
I have been looking for hours and feel like I am at a dead-end. I wanted to create an issue against the repo, but I am not confident that it is their issue. Something specific with what I have done with the build, but I do not know where the difference could be.
I was able to solve the issue by adding again the missing libraries that are not resolved when publishing a version with JitPack.
android: 'io.reactivex.rxjava2:rxandroid:2.1.0',
java : 'io.reactivex.rxjava2:rxjava:2.2.2',
relay : 'com.jakewharton.rxrelay2:rxrelay:2.1.0'

Android Glide library LicenseCheckError/DeadObjectException

Recently we started to get crashes (Firebase Crashlytics) that appear to be originating from Glide, we could not find any visible reason in our app that causes it and the stack trace points to Glide. please have a look at the attached StackTrace.
Any help will be greatly appreciated.
We do have custom implementation for the following classes:
AppGlideModule
DataFetcher
ModelLoader
but for URL fetching, we use Glide's GlideUrl which is the Glide Default.
build.gradle:
def glide_version = "4.11.0"
implementation "com.github.bumptech.glide:glide:$glide_version"
implementation "com.github.bumptech.glide:annotations:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
StackTrace:
Fatal Exception: com.bumptech.glide.load.engine.cache.util.LicenseCheckError$LicenseServiceError: Error when calling licensing service
at com.bumptech.glide.load.engine.cache.util.LicenseClient.callLicenseCheckV2Method(LicenseClient.java:136)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.checkLicenseInternal(LicenseClient.java:119)
at com.bumptech.glide.load.engine.cache.util.LicenseClient$LicenseServiceConnection.onServiceConnected(LicenseClient.java:162)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2037)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2069)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by android.os.DeadObjectException
at android.os.BinderProxy.transactNative(BinderProxy.java)
at android.os.BinderProxy.transact(BinderProxy.java:526)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.callLicenseCheckV2Method(LicenseClient.java:129)
at com.bumptech.glide.load.engine.cache.util.LicenseClient.checkLicenseInternal(LicenseClient.java:119)
at com.bumptech.glide.load.engine.cache.util.LicenseClient$LicenseServiceConnection.onServiceConnected(LicenseClient.java:162)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2037)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2069)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Edit:
this is not a "regular" DeadObjectException as it comes from within the Glide library that tries to access an internal LicenseCheckError class

MuPDF Library not working on X86 architectures

This question was already asked by someone, But there i can't find any clues about the issue. I am using MuPDF library to open and preview the .pdf files in our Android application. It's working fine other than few X86 architecture devices. I got the following issue
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.demo-1/lib/x86/libmupdf.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:988)
at com.artifex.mupdfdemo.MuPDFCore.(MuPDFCore.java:19)
at com.demo.openwith.OpenwithFragment.openFile(OpenwithFragment.java:789)
at com.demo.openwith.OpenwithFragment.openPDF(OpenwithFragment.java:671)
at com.demo.openwith.OpenwithFragment.onCreateView(OpenwithFragment.java:346)
at android.app.Fragment.performCreateView(Fragment.java:2053)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.app.BackStackRecord.run(BackStackRecord.java:834)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452)
at android.app.Activity.performStart(Activity.java:6047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
previously i have used the old library(.so) of the MuPDF. Now i have updated the recent library, even i am getting the same issue. Can anyone help me to find the reason and fix the issue.
create libs folder in app/src/main
then create folder x86 download this file and insert it
https://github.com/minaairsupport/MuPDF_Android_Studio/blob/master/app/src/main/jniLibs/x86/libmupdf_java.so

Mupdf lib crash on Samsung Galaxy Edge 6

I have following libs in my project :
Armeabi , Armeabi-v7a , mips , x86 they all have libmupdf.so while Samsung device looking for lib/arm64.
I am getting below crash on Samsung Galaxy Edge 6 .
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.engagebeyond.sasol-1/base.apk"],nativeLibraryDirectories=[/data/app/com.engagebeyond.sasol-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libmupdf.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.artifex.mupdflib.MuPDFCore.<clinit>(MuPDFCore.java:14)
at com.artifex.mupdflib.MuPDFActivity.openFile(MuPDFActivity.java:233)
at com.artifex.mupdflib.MuPDFActivity.onCreate(MuPDFActivity.java:445)
at android.app.Activity.performCreate(Activity.java:6500)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Do any one known how i can build lib for arm64 ?
As this phone will run 32bit libraries, one option is to just disable 64 for your application, which will then allow the Armeabi-v7a library to be used.
The easiest way to do this is using the abiFilter setting, see https://stackoverflow.com/a/30799825/292166

Android BarcodeScanner library crash in 64bits devices

We have an application using the Zbar library from BarcodeScanner with gradle:
compile 'me.dm7.barcodescanner:zbar:1.8.2'
Scanning works fine in all the devices except for those with 64bit. When we launch the scanner the screen turn black and we receive an exception:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/my.package.name-2/base.apk"],nativeLibraryDirectories=[/data/app/my.package.name-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libiconv.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at me.dm7.barcodescanner.zbar.ZBarScannerView.(ZBarScannerView.java:31)
at my.package.name.activity.BarcodeActivity.onCreate(BarcodeActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2879)
at android.app.ActivityThread.access$900(ActivityThread.java:182)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6141)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
It seems to be fixed in 1.8.4.
Try using version 1.9
compile 'me.dm7.barcodescanner:zbar:1.9'

Categories

Resources