Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The sysroot must be an absolute path" error when building custom native FFmpegKit binary. #592

Closed
SuganDevp opened this issue Oct 7, 2022 · 16 comments
Assignees
Labels
android Affect Android platform question Further information is requested scripts Affect build scripts

Comments

@SuganDevp
Copy link

SuganDevp commented Oct 7, 2022

Description
When I'm running the command --enable-freetype for android.

checking command to parse llvm-nm output from armv7a-linux-androideabi24-clang object... ok
checking for sysroot... C:/Users/sugan/AppData/Local/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot
configure: error: The sysroot must be an absolute path.

This error logged in build.log file.

To Reproduce
Run command ./android.sh --enable-freetype and check build.log .

Logs
Complete log file build.log

Environment

  • Platform: Windows for Android
  • Version: v5.1
  • Source branch: main
  • Android NDK version: 25.1.8937393
@tanersener
Copy link
Collaborator

Unfortunately, we do not officially support building the Android library on Windows. The last time we tried, some external libraries were not compatible with Windows Subsystem for Linux. And, the effort needed to patch & maintain them was big. Furthermore, there wasn't a standard package manager on Windows. Even installing prerequisites we have for Android was a problem. Therefore, we decided against supporting it. We have a note about it in our NDK Compatibility guide.

So, we do not guarantee that build script will not fail there.

Logs show that libpng library is not happy about the sysroot provided. I really have no idea why.

My suggestion is to make sure that Android prerequisites are installed and accessible in your PATH. Also, to disable arm-v7a architecture, because it is not supported on Android NDK >= 24.

@tanersener tanersener added question Further information is requested android Affect Android platform scripts Affect build scripts labels Oct 7, 2022
@SuganDevp
Copy link
Author

SuganDevp commented Oct 7, 2022

Then can I try in linux? Is that works? Which platform will be best?

@tanersener
Copy link
Collaborator

tanersener commented Oct 7, 2022

Linux is the best host for Android.

See our Github Actions we have for Android on Linux there.

@SuganDevp
Copy link
Author

Thank you so much @tanersener for your help and quick response. I have build in linux system.

I got this error

Something went wrong bootstrapping makefile fragments
    for automatic dependency tracking.  If GNU make was not used, consider
    re-running the configure script with MAKE="gmake" (or whatever is
    necessary).  You can also try re-running configure with the
    '--disable-dependency-tracking' option to at least be able to build
    the package (albeit without support for automatic dependency tracking).

I have solved this by adding --disable-dependency-tracking in ./configure. Is that fine?

@tanersener
Copy link
Collaborator

Could you be more specific? When do you get this error, and to which configure are you applying this option?

android.sh doesn't support that option.

@SuganDevp
Copy link
Author

I have added --disable-dependency-tracking in libpng.sh file.

@tanersener
Copy link
Collaborator

Well, adding it won't break anything. So, it's fine.

But, also it is not something we see. Do you have all prerequisites listed in Android Prerequisites ?

@SuganDevp
Copy link
Author

For LTS build with ndk version we have to use?

@SuganDevp
Copy link
Author

SuganDevp commented Oct 8, 2022

Can you please help me on how to add the generated aar file.

I have tried many methods to add the generated aar file. I can't able to achieve that.

How to add custom build library ad per documentation The hybrid plugin must be cloned and native FFmpegKit dependency it has must be replaced with the custom library built..

Please help me out.

@tanersener
Copy link
Collaborator

Would you mind having a look at the How to Decrease Binary Size page again. It seems like you are looking at an old version.

And, importing an aar file into an android project is something you can easily find on android documentation or google. Could you check one of those two please?

@SuganDevp
Copy link
Author

I looking for using aar file for my flutter app. Is the same Android documentation works for flutter?

@tanersener
Copy link
Collaborator

If you look at the directory structure of the flutter plugin you can see that there is an android folder, an ios folder and a macos folder.

  • android folder includes a standard android project. Android rules apply there
  • ios folder includes an iOS project
  • macos folder includes a macOS project

@SuganDevp
Copy link
Author

How to build aar for LTS version.

When I use --lts

aarch64-linux-android16-clang command not found

error is logged in config.log

@tanersener
Copy link
Collaborator

See NDK Compatibility page.

@SuganDevp
Copy link
Author

Thanks a lot...!

I have reduced upto the size 35 MB.

Thanks for your great support.

@tanersener tanersener self-assigned this Oct 18, 2022
@sreetejadusi
Copy link

@SuganDevp can you make the package open-source? I'm a beginner and I quite don't understand reducing the binary size of compiled APK while using Ffmpeg-kit for Flutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform question Further information is requested scripts Affect build scripts
Projects
None yet
Development

No branches or pull requests

3 participants