Code Monkey home page Code Monkey logo

Comments (16)

wang-bin avatar wang-bin commented on June 3, 2024

what's your cmake version?

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

what's your cmake version?

i dont know how to check it, can you let me know.

in terminal its cmake version 3.27.1

but i dont know if that what flutter uses

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

You are running version 3.10.2 this is the cmake version flutter is using when building

also this is the line causing the problem target_link_libraries(mdk INTERFACE mdk-ffmpeg) # ensure libffmpeg.so will be copied by gradle

in the findMDK.cmake

also i tried to play with the configs abit

like setting in find mdk

cmake_minimum_required(VERSION 3.10)

# Project-level configuration.
set(PROJECT_NAME "mdk")
project(${PROJECT_NAME} LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

but i made more errors appear i think

  -- Build files have been written to: /Users/AbdelazizMahdy/flutter_projects/fvp/android/.cxx/Debug/1x3s5o22/armeabi-v7a
  [1/3] Building CXX object CMakeFiles/fvp_plugin.dir/fvp_plugin.cpp.o
  FAILED: CMakeFiles/fvp_plugin.dir/fvp_plugin.cpp.o 
  /Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi16 --gcc-toolchain=/Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot  -DDART_SHARED_LIB -DFLUTTER_PLUGIN_IMPL -Dfvp_plugin_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -fPIC -fvisibility=hidden   -std=gnu++1z -MD -MT CMakeFiles/fvp_plugin.dir/fvp_plugin.cpp.o -MF CMakeFiles/fvp_plugin.dir/fvp_plugin.cpp.o.d -o CMakeFiles/fvp_plugin.dir/fvp_plugin.cpp.o -c ../../../../fvp_plugin.cpp
  ../../../../fvp_plugin.cpp:10:10: fatal error: 'mdk/Player.h' file not found
  #include <mdk/Player.h>
           ^~~~~~~~~~~~~~
  1 error generated.
  [2/3] Building CXX object CMakeFiles/fvp_plugin.dir/Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp.o
  FAILED: CMakeFiles/fvp_plugin.dir/Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp.o 
  /Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi16 --gcc-toolchain=/Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/Users/AbdelazizMahdy/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/sysroot  -DDART_SHARED_LIB -DFLUTTER_PLUGIN_IMPL -Dfvp_plugin_EXPORTS  -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -fPIC -fvisibility=hidden   -std=gnu++1z -MD -MT CMakeFiles/fvp_plugin.dir/Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp.o -MF CMakeFiles/fvp_plugin.dir/Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp.o.d -o CMakeFiles/fvp_plugin.dir/Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp.o -c /Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp
  /Users/AbdelazizMahdy/flutter_projects/fvp/lib/src/callbacks.cpp:5:10: fatal error: 'mdk/Player.h' file not found
  #include "mdk/Player.h"
           ^~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

i just cloned the repo and it works on your example, which is weird,

since using i am using the package locally on both cases while trying.

the only reason i think it maybe failing is gradle versions or cmake versions, since your was using cmake 3.22 mine was 3.10

from fvp.

wang-bin avatar wang-bin commented on June 3, 2024

What about upgrading your cmake?

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

i dont know how to do it in flutter, does setting the ndk version does that?

from fvp.

wang-bin avatar wang-bin commented on June 3, 2024

btw, you have to upgrade ndk too. I use ndk 25, but ndk 23 breaks abi, you must use ndk 23 or later

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

i did set the ndk version for ndkVersion "25.2.9519653"
but the cmake is still version 3.10.2

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

setting version "3.22.1"
in your package

  externalNativeBuild {
       cmake {
           // version "Your.CMake.Version"
       
           path "CMakeLists.txt"
           // The default CMake version for the Android Gradle Plugin is 3.10.2.
           // https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
           //
           // The Flutter tooling requires that developers have CMake 3.10 or later
           // installed. You should not increase this version, as doing so will cause
           // the plugin to fail to compile for some customers of the plugin.
           // version "3.10.2"
           version "3.22.1"
       }
   }

made it compile without errors finally i think thats not a valid fix since it just has to be higher than 3.20 correct?

but at least now we know what is the problem

from fvp.

wang-bin avatar wang-bin commented on June 3, 2024

i need to know how cmake version is selected. If use ndk 23 or later is installed, then higher version of ndk and cmake will be used.

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

when i did use ndkVersion "25.2.9519653" alone it was still using cmake 3.10.2

setting the cmake like mentioned was the only fix that worked for my case

i updated the pr to allow anything after 3.22.0, do you think we should set the ndk version in the package to make sure all people has the cmake version updated?

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

maybe this is the cause
https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
image

your example uses classpath 'com.android.tools.build:gradle:8.0.2'

and mine uses classpath 'com.android.tools.build:gradle:7.0.4'

so from the image by default i use the 21.4.7075529 this is the main problem i think

from fvp.

AnonymHK avatar AnonymHK commented on June 3, 2024

Okay, I'll give it a try !

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

updating from classpath 'com.android.tools.build:gradle:7.0.4'
to classpath 'com.android.tools.build:gradle:7.4.2' fixed the error also i updated to version 0.2.0

from fvp.

AnonymHK avatar AnonymHK commented on June 3, 2024

This solution is not valid for me. I will try again after your new version is released!

from fvp.

zezo357 avatar zezo357 commented on June 3, 2024

This solution is not valid for me. I will try again after your new version is released!

your issue is related to this #13
so its okay

from fvp.

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.