You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[android] Cannot specify link libraries for target "mdk" which is not built by this #10
* What went wrong:
Execution failed for task ':fvp:configureCMakeDebug'.
> C/C++: /Users/AbdelazizMahdy/.pub-cache/hosted/pub.dev/fvp-0.1.0/android/CMakeLists.txt debug|armeabi-v7a : CMake Error at /Users/AbdelazizMahdy/.pub-cache/hosted/pub.dev/fvp-0.1.0/android/mdk-sdk/lib/cmake/FindMDK.cmake:260 (target_link_libraries):
Cannot specify link libraries for target "mdk" which is not built by this
project.
Call Stack (most recent call first):
CMakeLists.txt:67 (include)
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?
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?
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
Activity
wang-bin commentedon Aug 21, 2023
what's your cmake version?
abdelaziz-mahdy commentedon Aug 21, 2023
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
abdelaziz-mahdy commentedon Aug 21, 2023
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 gradlein the findMDK.cmake
also i tried to play with the configs abit
like setting in find mdk
but i made more errors appear i think
abdelaziz-mahdy commentedon Aug 21, 2023
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
wang-bin commentedon Aug 21, 2023
What about upgrading your cmake?
abdelaziz-mahdy commentedon Aug 21, 2023
i dont know how to do it in flutter, does setting the ndk version does that?
wang-bin commentedon Aug 21, 2023
btw, you have to upgrade ndk too. I use ndk 25, but ndk 23 breaks abi, you must use ndk 23 or later
abdelaziz-mahdy commentedon Aug 21, 2023
i did set the ndk version for ndkVersion "25.2.9519653"
but the cmake is still version 3.10.2
abdelaziz-mahdy commentedon Aug 21, 2023
setting version "3.22.1"
in your package
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
wang-bin commentedon Aug 21, 2023
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.
abdelaziz-mahdy commentedon Aug 21, 2023
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?
abdelaziz-mahdy commentedon Aug 21, 2023
maybe this is the cause

https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
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
AnonymHK commentedon Aug 21, 2023
Okay, I'll give it a try !
abdelaziz-mahdy commentedon Aug 21, 2023
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.0AnonymHK commentedon Aug 21, 2023
This solution is not valid for me. I will try again after your new version is released!
abdelaziz-mahdy commentedon Aug 21, 2023
your issue is related to this #13
so its okay
android: release the texture entry after the mdk player is destroyed
android: release the texture entry after the mdk player is destroyed