Android Chromium Build fail with NDK Library Load - android

Whenever we trying to build Chromium in android studio that time its fail to load NDK library.
Error logs are here :
org.chromium.base.library_loader.ProcessInitException: errorCode=4
at org.chromium.chrome.browser.init.AsyncInitializationActivity.onStartupFailure(AsyncInitializationActivity.java:286)
at org.chromium.chrome.browser.init.NativeInitializationController$1.onFailure(NativeInitializationController.java:101)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.tasksPossiblyComplete(AsyncInitTaskRunner.java:182)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.lambda$null$0$AsyncInitTaskRunner(AsyncInitTaskRunner.java:127)
at org.chromium.chrome.browser.init.-$$Lambda$AsyncInitTaskRunner$cJc0Kjib2rp_haGN4uefBvQ1s58.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
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:1100)
Caused by: org.chromium.base.library_loader.ProcessInitException: errorCode=2
at org.chromium.base.library_loader.LibraryLoader.loadMainDexAlreadyLocked(LibraryLoader.java:662)
at org.chromium.base.library_loader.LibraryLoader.ensureMainDexInitialized(LibraryLoader.java:456)
at org.chromium.base.library_loader.LibraryLoader.ensureInitialized(LibraryLoader.java:440)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.loadNativeLibrary(AsyncInitTaskRunner.java:138)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.lambda$startBackgroundTasks$1$AsyncInitTaskRunner(AsyncInitTaskRunner.java:126)
at org.chromium.chrome.browser.init.-$$Lambda$AsyncInitTaskRunner$xIQXLdsNGYGpypXLZkBvhfVEoSo.run(Unknown Source:2)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/base.apk"],nativeLibraryDirectories=[/data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/lib/arm, /data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libc++_chrome.cr.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at org.chromium.base.library_loader.LibraryLoader.loadWithSystemLinkerAlreadyLocked(LibraryLoader.java:617)
at org.chromium.base.library_loader.LibraryLoader.loadMainDexAlreadyLocked(LibraryLoader.java:653)
Please review this and share solution if you have any thank you.

Related

Remove conflicting slf4j packages from External aar Android

I have integrated an SDK .aar which contains packages for slf4j library and already have one library which is using different artifacts.Therefore app code is calling to library and library not considering it artefact packages and call it from SDK due to that app is crashing. crash logs are as follows.
java.lang.ExceptionInInitializerError
at template_engine.TemplateEngine.<init>(TemplateEngine.kt:84)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
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:1100)
Caused by: java.lang.NullPointerException: throw with null exception
** at org.slf4j.impl.Log4jLoggerFactory.getLogger(Unknown Source:1) ** // it is calling from SDK
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at com.github.jknack.handlebars.Handlebars.<clinit>(Handlebars.java:251)
at template_engine.TemplateEngine.<init>(TemplateEngine.kt:84)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:237) 
at android.app.ActivityThread.main(ActivityThread.java:8107) 
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:1100) 
Please Help me with these i have already tried exclude it from Gradle SDK .aar but it is not working. Thanks in advance.

java.lang.UnsatisfiedLinkError after enabling progaurd

java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/app.trell-cObHRbb2g2I_GJO51h1Usw==/lib/arm64/libNvStreamingSdkCore.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at com.meicam.sdk.NvsStreamingContext.C(NvsStreamingContext.java:16)
at com.meishe.sdkdemo.MSApplication.init(MSApplication.java:4)
at com.meishe.sdkdemo.MSAppLoaderImpl.initMSApplication(MSAppLoader.kt:1)
at app.geochat.revamp.utils.Utils.b0(Utils.java:3)
at app.geochat.revamp.activity.HomeGenericActivity.Y0(HomeGenericActivity.java:24)
at app.geochat.revamp.activity.HomeGenericActivity.onClick(HomeGenericActivity.java:223)
at android.view.View.performClick(View.java:7254)
at android.view.View.performClickInternal(View.java:7212)
at android.view.View.access$3800(View.java:828)
at android.view.View$PerformClick.run(View.java:27889)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:227)
at android.app.ActivityThread.main(ActivityThread.java:7822)
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:1026)
java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad after enabling progaurd
You need to exclude a class from proguard. One of the lib. you're using rely on a C++ library and it's getting swallowed by proguard

Android Singed APK crashed

I am facing issue with the Signed APK, debug apk works perfectly, When I generate signed apk and run it show error.
below is error log
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.woodenstreet, PID: 25818
java.lang.NoSuchMethodError: No virtual method x(Ljava/lang/String;I)I in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /apex/com.android.runtime/javalib/core-libart.jar)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.d(SourceFile:1)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.e(SourceFile:2)
at com.google.firebase.crashlytics.internal.settings.SettingsController.(SourceFile:11)
at com.google.firebase.crashlytics.internal.settings.SettingsController.l(SourceFile:14)
at com.google.firebase.crashlytics.internal.Onboarding.l(SourceFile:4)
at com.google.firebase.crashlytics.FirebaseCrashlytics.a(SourceFile:26)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.b(SourceFile:5)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.a(Unknown Source:0)
at com.google.firebase.crashlytics.CrashlyticsRegistrar$$Lambda$1.a(Unknown Source:2)
at com.google.firebase.components.ComponentRuntime.f(SourceFile:1)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(SourceFile:6)
at com.google.firebase.components.ComponentRuntime.e(SourceFile:5)
at com.google.firebase.FirebaseApp.n(SourceFile:7)
at com.google.firebase.FirebaseApp.q(SourceFile:13)
at com.google.firebase.FirebaseApp.p(SourceFile:1)
at com.google.firebase.FirebaseApp.o(SourceFile:7)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:1)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2092)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2066)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
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)
Here build.gradle app level file
Build file
I am not able to figure out the error please help me.
Thanks
Your release configuration in build.gradle is not correct for your libraries. I think it have to do with json, and proguard obfuscates some methods of it.
try this https://stackoverflow.com/a/61481954/10117882

Getting classNotFindException when using Firebase performance lib with slyce android sdk

I am currently stuck with integrating the new firebase perf with my current android app. Everything works fine when I disable it i.e., firebasePerformanceInstrumentationEnabled = false. But I keep getting the below error when I enable it i.e., set it's value to true`.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.testflight.app, PID: 22011
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/neovisionaries/ws/client/D;
at com.neovisionaries.ws.client.WebSocketFactory.<init>(SourceFile:2)
at it.slyce.sdk.internal.SlyceWebSocketWorkflowTask.e(SourceFile:1)
at it.slyce.sdk.internal.SlyceWebSocketWorkflowTask.onEncodingComplete(SourceFile:3)
at it.slyce.sdk.internal.BitmapEncodingTask.a(SourceFile:4)
at it.slyce.sdk.internal.BitmapEncodingTask.onPostExecute(SourceFile:1)
at android.os.AsyncTask.finish(AsyncTask.java:755)
at android.os.AsyncTask.access$900(AsyncTask.java:192)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7811)
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:1076)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.neovisionaries.ws.client.D" on path: DexPathList[[zip file "/data/app/com.ashleyfurniturehomestore.ecomm-X1w1G27mqcSRlwfLujt7mQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.testflight.app-X1w1G27mqcSRlwfLujt7mQ==/lib/arm64, /data/app/com.testflight.app-X1w1G27mqcSRlwfLujt7mQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/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 com.neovisionaries.ws.client.WebSocketFactory.<init>(SourceFile:2)
at it.slyce.sdk.internal.SlyceWebSocketWorkflowTask.e(SourceFile:1)
at it.slyce.sdk.internal.SlyceWebSocketWorkflowTask.onEncodingComplete(SourceFile:3)
at it.slyce.sdk.internal.BitmapEncodingTask.a(SourceFile:4)
at it.slyce.sdk.internal.BitmapEncodingTask.onPostExecute(SourceFile:1)
at android.os.AsyncTask.finish(AsyncTask.java:755)
at android.os.AsyncTask.access$900(AsyncTask.java:192)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7811)
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:1076)
How can I solve this?
Try to run with proguard disabled. If it works, you need to edit your ProguardRules.pro file to exclude Firebase libraries.

java.lang.ClassNotFoundException: com.google.android.gms.common.GoogleApiAvailability Occurs when try to integrate arcore with mediapipe

I am working to integrate arcore and mediapipe application.But when I try to integrate arcore in mediapipe source code I get an issue with session object which is as under.
Getting following issue when try to create Session Object of ARCore
E/ARCore-AuthenticationManager: Exception during AuthenticationManager construction:
com.google.android.gms.common.GoogleApiAvailability
java.lang.ClassNotFoundException: com.google.android.gms.common.GoogleApiAvailability
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at com.google.ar.persistence.AuthenticationManager.a(PG:72)
at com.google.ar.persistence.AuthenticationManager.(PG:4)
at com.google.ar.persistence.AuthenticationManagerFactory.create(PG:3)
at com.google.ar.core.Session.nativeCreateSessionAndWrapper(Native Method)
at com.google.ar.core.Session.(Session.java:5)
at com.example.handtrackinggradle.MainActivity.startCamera(MainActivity.java:324)
at com.example.handtrackinggradle.MainActivity.onResume(MainActivity.java:171)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416)
at android.app.Activity.performResume(Activity.java:7609)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4013)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4053)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState
(TransactionExecutor.java: 145)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7076)
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:965)
Caused by: java.lang.ClassNotFoundException: Didn't find class
"com.google.android.gms.common.GoogleApiAvailability" on path: DexPathList[[zip file
"/data/app/com.example.handtrackinggradle-
p0OQ0rOqD7I0DpvWKOl4_A==/base.apk"],nativeLibraryDirectories=
[/data/app/com.example.handtrackinggradle-p0OQ0rOqD7I0DpvWKOl4_A==/lib/arm64,
/data/app/com.example.handtrackinggradle-p0OQ0rOqD7I0DpvWKOl4_A==/base.apk!/lib/arm64-
v8a, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:1
I solved this issue by adding following dependency.This issue is caused because of AR Session which is dependent on the below dependency
com.google.android.gms:play-services-auth:17.

Categories

Resources