Android App Bundle - native code library failed to load - android-app-bundle

I need to replace the APK to App Bundle feature.
My app using some SDK with native libraries.
The app build.gradle dependencies countains:
     implementation files ('libs / refsi.jar')
     implementation files ('libs / tsi.jar')
The SDK native libraries (two .so files for each architecture) placed under /app/src/main/jniLibs/ (armeabi-v7a | arm64-v8a | x86 | x86_64 | armeabi)
I tried to use googles instructions, and I was looking for help, but after I download the app from google play to my test device, the SDK was not working - the log file shows that the files not found.
"...Native code library failed to load. dalvik.system.PathClassLoader[DexPathList[
[zip file "/data/app/ ....
Please help me understand the correct and simple way to use an app bundle in that case.

This might help you, according to google doc
When building an Android App Bundle, APKs generated from that app bundle that target Android 6.0 (API level 23) or higher now include uncompressed versions of your native libraries by default. This optimization avoids the need for the device to make a copy of the library and thus reduces the on-disk size of your app. If you'd rather disable this optimization, add the following to your gradle.properties file:
android.bundle.enableUncompressedNativeLibs = false

Related

Error when using sqflite_common_ffi instead of sqfilte on Android

For targeting mulitple platforms, I want to use sqflite_common_ffi instead of sqflite (sqflite_common_ffi is compatible with Windows).
But when I run my project on Android, I have this exception when runningdatabaseFactoryFfi.openDatabase method:
Invalid argument(s): Failed to load dynamic library '/data/data/com.coutier.scool/lib/libsqlite3.so': dlopen failed: library "/data/data/com.coutier.scool/lib/libsqlite3.so" not found
I do not understand : sqlite not supposed to be included in android ? Why this package want to load a specific library ?
If I really need this library to make sqflite_common_ffi run, where can I find this library and where have I to put in my project tree ?
On iOS and Android, you can add sqlite3_flutter_libs that includes the binaries for iOS and Android. sqflite_common_ffi uses sqlite3 and its default library loader should work as is.

Flutter - Load an asset file into an external Flutter plugin

I am developing a Flutter plugin with native Platform View. My PlatformView needs a file which is project dependant. I want to pass my file path which is in example project to my library project (Native Android/iOS code). In simple words how can I access my project assets in external library from example/test project.
I was thinking about changing src directory in android gradle but I'm confused how to set scrc directorry to an example project.
flutter_library_project
- android
access file here
- iOS
access file here
- libs
Flutter_library_sample
- assets
file
- android
- iOS
- libs
can access file here

How to use libflutter_linux_glfw.so file and related files from out/host_debug of flutter engine

I followed instructions from Setting up the Engine development to build the flutter engine. Purpose of this was to use the texture support from Texture support for glfw. I could compile the flutter engine.
Next I wanted to use this engine and develop Texture based application. While compiling using the following command, I see that libflutter_linux_glfw.so and other platform files are copied from flutter/bin/cache/artifacts/engine.
flutter build linux
I added the dependency_overrides to pubspec.yaml as follows. But, no luck.
dependency_overrides:
sky_engine:
path: <base folder of engine>/engine/src/out/host_debug_unopt/gen/dart-pkg/sky_engine
sky_services:
path: <base folder of engine>/engine/src/out/host_debug_unopt/gen/dart-pkg/sky_services
Looking forward for the suggestions on the changes required to use files from engine/src/out/host_debug_unopt.
I could use compiled libflutter_linux_glfw.so by using --local-engine-src-path and --local-engine options of flutter given in the following link.
Using a locally-built engine with the flutter tool

export android project add facebook sdk get error convert to dalvik format failed with error 1

i am doing a small project on android and it using facebook sdk 3.0. everything is ok until i export to upload android market, i got error "error convert to dalvik format failed with error 1" and i try export 2 sample projects in sdk, i got same error. i research on google ,the cause is the projects and facebook sdk have same name file R.java in com.facebook.android. But because it file R.java so i cannot rename it. i try other way, i turn off "build automatically" and delete R.java file in facebook sdk, it can export keystore and apk file but apk file don not work. So what can i do to fix it?
thanks
I was having this problem too with an app that used Facebook SDK. I was trying all sorts of stuff, so I'm not sure what exactly fixed but here's settings that worked for me:
FacebookSDK > Properties > Java Build Path > Order and Export
Android 2.2 - NOT CHECKED
Android Private Libraries - CHECKED
Android Dependencies - CHECKED
MyApp > Properties > Java Build Path > Order and Export
Android 4.2.2 - CHECKED
Android Private Libraries - CHECKED
Android Dependencies - CHECKED
In addition, I had done this before, not sure it mattered. Reverted to Facebook SDK version 3.5 from 3.5.2. Updated to latest ADT 22.2.1. Changed Facebook SDK to use Android 2.2 from 4.2.2.

Running on a real device (iPhone) linker error for an archive file

I'm using CorePlot in my project by adding the project file directly in the project. When I compile it for simulator it is fine, but when I try to compile it for the real device it says:
"clang: error: no such file or directory:
'/Users/t2wu/Library/Developer/Xcode/DerivedData/HRM-fqohcvzyvosuqmerfynaixyulpta/Build/Products/Debug-iphoneos/libCorePlot-CocoaTouch.a'"
What could be the problem? I'm using iPhone 4S with iOS 6 SDK with architecture set to Standard(armv7, armv7s) for both the super project and the embedded CorePlot.
In Target Project Build Setting Make Buidl Architecture Only = YES. This will solve your problem.
Clang is the compiler. Make sure you have a libCorePlot-CocoaTouch.a file in your project.