Giter VIP home page Giter VIP logo

Comments (13)

kirtisinghvliv avatar kirtisinghvliv commented on July 1, 2024 1

i'm using Dynamic Feature Module for a feature which has third SDK library as .AAR file.
When analysing the apk i found out this sdk is using Native / C++ codes and the structure is like:
Screen Shot 2019-09-18 at 2 43 20 pm

i know that in dynamic module when we want to use native libs we should implement for instance something like :SplitInstallHelper.loadLibrary(this, "tensorflowlite_gpu_gl")
however i'm getting this error:
java.lang.UnsatisfiedLinkError: dlopen failed: library "libtensorflowlite_gpu_gl.so" not found

I'm not sure in Gradle in dynamic module what should i do to be able to load those .so libs?

Hi @elmira-asd mentioned issue if you are able to fix please guide me, same issue i am facing.
Thanks for your help in advance!

from app-bundle-samples.

crocodilys avatar crocodilys commented on July 1, 2024

Hi, @elmira-asd! I encountered the same issue. Did you solve that one?

from app-bundle-samples.

elmira-asd avatar elmira-asd commented on July 1, 2024

@crocodilys Hi there, first i loaded the libs kind of locally calling System.loadLibrary("c++_shared") and it worked fine, but it's not recommended if you have another libs (you can check when analysing the apk) because in . my case i should have been careful about different system/device architectures, in some devices it may crash!

from app-bundle-samples.

keyboardsurfer avatar keyboardsurfer commented on July 1, 2024

Does this module help?

from app-bundle-samples.

elmira-asd avatar elmira-asd commented on July 1, 2024

This Module will definitely help if i have those C++ libs in my libs, but they were wrapped as .AAR file. that was the reason i couldn't use SplitInstallHelper to load those libraries!
so i should have extract those files and then using SplitInstallHelper!

from app-bundle-samples.

elmira-asd avatar elmira-asd commented on July 1, 2024

@crocodilys Still not recommended if you're using third SDK, so you can ask them to fix this one in their side

from app-bundle-samples.

keyboardsurfer avatar keyboardsurfer commented on July 1, 2024

It shouldn't matter whether the .so are included via an aar or directly within the feature they're used in. The Context you're passing in to loadLibrary might though. You may have to create a new context before the library can be loaded like shown in the documentation here: https://developer.android.com/guide/app-bundle/playcore#load_native_libs

from app-bundle-samples.

KonsRaspopov avatar KonsRaspopov commented on July 1, 2024

@elmira-asd Still cannot understand if you were able to use TensorFlow in a dynamic feature or not. I faced the same problem. Still not sure if calling SplitInstallHelper.loadLibrary before using TensorFlow classes will help(as they will call System.loadLibrary inside and it might crash).

from app-bundle-samples.

keyboardsurfer avatar keyboardsurfer commented on July 1, 2024

Closing this as it's not related to the sample at hand any longer. Feel free to ask a question on StackOverflow and link it here.

from app-bundle-samples.

elmira-asd avatar elmira-asd commented on July 1, 2024

i'm using Dynamic Feature Module for a feature which has third SDK library as .AAR file.
When analysing the apk i found out this sdk is using Native / C++ codes and the structure is like:
Screen Shot 2019-09-18 at 2 43 20 pm
i know that in dynamic module when we want to use native libs we should implement for instance something like :SplitInstallHelper.loadLibrary(this, "tensorflowlite_gpu_gl")
however i'm getting this error:
java.lang.UnsatisfiedLinkError: dlopen failed: library "libtensorflowlite_gpu_gl.so" not found
I'm not sure in Gradle in dynamic module what should i do to be able to load those .so libs?

Hi @elmira-asd mentioned issue if you are able to fix please guide me, same issue i am facing.
Thanks for your help in advance!

It's better to change the .ARR file rather than the app, also try to use SplitCompat.installActivity(this) instead of just calling SplitCompat.install(this) it helps immediate access to a given activity.

from app-bundle-samples.

imaiya avatar imaiya commented on July 1, 2024

@elmira-asd I have the same problem as you, a third-party aar contains multiple so files, and the aar already uses System.loadLibrary. How should I solve it?

from app-bundle-samples.

imaiya avatar imaiya commented on July 1, 2024

@elmira-asd

i'm using Dynamic Feature Module for a feature which has third SDK library as .AAR file.我正在使用动态功能模块来实现具有第三个 SDK 库作为 .AAR 文件的功能。
When analysing the apk i found out this sdk is using Native / C++ codes and the structure is like: 在分析 apk 时,我发现这个 sdk 使用 Native / C++ 代码,结构如下:
Screen Shot 2019-09-18 at 2 43 20 pm
i know that in dynamic module when we want to use native libs we should implement for instance something like :SplitInstallHelper.loadLibrary(this, "tensorflowlite_gpu_gl") 我知道在动态模块中,当我们想要使用本机库时,我们应该实现例如: SplitInstallHelper.loadLibrary(this, "tensorflowlite_gpu_gl")
however i'm getting this error:但是我收到这个错误:
java.lang.UnsatisfiedLinkError: dlopen failed: library "libtensorflowlite_gpu_gl.so" not found java.lang.UnsatisfiedLinkError:dlopen失败:找不到库“libtensorflowlite_gpu_gl.so”
I'm not sure in Gradle in dynamic module what should i do to be able to load those .so libs?我不确定在动态模块的 Gradle 中我应该做什么才能加载这些 .so 库?

Hi @elmira-asd mentioned issue if you are able to fix please guide me, same issue i am facing.您好,如果您能够解决提到的问题,请指导我,我面临着同样的问题。
Thanks for your help in advance! 提前感谢您的帮助!

It's better to change the .ARR file rather than the app, also try to use SplitCompat.installActivity(this) instead of just calling SplitCompat.install(this) it helps immediate access to a given activity.最好更改 .ARR 文件而不是应用程序,还尝试使用 SplitCompat.installActivity(this) 而不是仅仅调用 SplitCompat.install(this) 它有助于立即访问给定的活动。

The .aar file is third party and I can't change it. Strange if I kill the app and restart it, everything is fine

from app-bundle-samples.

lianyagang avatar lianyagang commented on July 1, 2024

SplitCompat

你可真爱关闭issue,并且没有一次是有提供有效信息的。你就不能搞个demo出来吗?动态模块里面依赖aar,这个aar包含第三方so库。你会怎么去使用。搞一个demo很难吗。天天就爱关闭issue。你的kpi是靠这个来的吗

from app-bundle-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.