Closed abdullahIsa closed 2 years ago
Possibly related to #624
Hey @chrfalch This is turning out to be a blocker for building it on android. Any idea, how we can resolve this issue?
@quicksilverr replace
def rnAAR = fileTree("${nodeModules}/react-native/android").matching({ it.include "**/**/*.aar" }).singleFile
with
def buildType = "debug"
tasks.all({ task ->
if (task.name == "buildCMakeRelease") {
buildType = "release"
}
})
def rnAarMatcher = "**/react-native/**/*${buildType}.aar"
def rnAAR = fileTree("${nodeModules}/react-native/android").matching({ it.include rnAarMatcher }).singleFile
Awesome @hungnq139! I had a similar fix - seems to work when synching but still fails in CMake when compiling. Is this your experience as well?
@hungnq139 Please could you share which file we need to do this in?
@hungnq139 Please could you share which file we need to do this in?
In the gradle-file found here under your project root: node_modules/@shopify/react-native-skia/android/build.gradle
@chrfalch Yes, I also have a similar experience. It fails in CMake while compiling, I double checked, I do have CMake installed in android studio.
Could you try adding the following to the CMakeLists.txt file after line 55:
"${NODE_MODULES_DIR}/react-native/ReactCommon"
Hey @chrfalch I tried adding your suggestion, but this is the error that I'm facing while, running yarn android
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
[CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
[CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':shopify_react-native-skia'.
> [CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
I have installed CMake from android studios -> sdk manager, shall I download the downgraded version?
It works, downloaded the needed version, thanks a lot guys, shall we create a PR for it?
Great that it works. The Android build system for building C++ code in React Native is (in my opinion) still a bit immature, like which version of CMake to use etc. We're super happy for PRs and contributions, so go ahead @quicksilverr!
@chrfalch after upgrading to expo sdk 46, on EAS build we are facing the error as described by @quicksilverr. AFAIK, there is no way to specify CMake version on EAS, any possible fixes we can do on the library side of things?
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
[CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
[CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.18.1' found in SDK did not satisfy requested version.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':shopify_react-native-skia'.
> [CXX1300] CMake '3.10.2' was not found in SDK, PATH, or by cmake.dir property.
@thespacemanatee - this project will show you how to set up CMake appropriately: https://github.com/brentvatne/try-skia - notice the eas-build-pre-install
hook in package.json and pre-install.sh
cc @Kudo / @chrfalch - we should coordinate on making this work out of the box on eas build, this was a bit of an oversight on our part
@brentvatne Thank you for the repo. Had to make sure to chmod +x
the script as well otherwise it would through permission error on EAS build servers.
@chrfalch is cmake 3.10.2 here is a hard requirement? is it possible to remove the line to make it more flexible?
supposedly AGP could download required cmake automatically. someone came across similar issues as well. not sure whether it's license issue or what.
It shouldn't be a hard requirement - I've created an issue to follow up on this one: #739
thanks @chrfalch for the fix 🎉
Np, @Kudo!! Thanks for the suggestion :) :) We will release a new version very soon with this and some other fixes.
Hello, i am upgraded my react native and started to get this error, not sure whats the cause, thanks.