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

During Android build, CMake '3.18.1' was not found in SDK #48

Closed
spring321 opened this issue Jan 26, 2024 · 6 comments
Closed

During Android build, CMake '3.18.1' was not found in SDK #48

spring321 opened this issue Jan 26, 2024 · 6 comments

Comments

@spring321
Copy link

Gradle task assembleAppRelease failed with exit code 1

[CXX1300] CMake '3.18.1' was not found in SDK, PATH, or by cmake.dir property.
[CXX1301] - CMake '3.22.1' found in SDK did not satisfy requested version.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':pdfrx'.

java.lang.NullPointerException (no error message)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 2s
Running Gradle task 'assemblePadRelease'...
Gradle task assemblePadRelease failed with exit code 1

flutter doctor --verbose
[✓] Flutter (Channel stable, 3.16.5, on macOS 13.4 22F66 darwin-arm64 (Rosetta), locale zh-Hans-CN)
• Flutter version 3.16.5 on channel stable at /Users/spring/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (5 weeks ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

Apple M2

not be able to run
@espresso3389
Copy link
Owner

espresso3389 commented Jan 26, 2024

I'm not gradle professional but in build.gradle, there's an explicit CMake version config.
I'm not sure why it is there and what happens if I remove the version specification...

version "3.18.1"

@espresso3389 espresso3389 changed the title A problem occurred configuring project ':pdfrx'. > java.lang.NullPointerException (no error message) During Android build, CMake '3.18.1' was not found in SDK Jan 31, 2024
@espresso3389
Copy link
Owner

On 0.4.31, I removed the version spec. on build.gradle anyway.

@espresso3389
Copy link
Owner

flutter/flutter #75600 seems very similar.

@espresso3389
Copy link
Owner

espresso3389 commented Feb 5, 2024

And, it seems that I can specify CMake version like version "3.18.1+" though it may hit gradle/gradle #16555.

@espresso3389
Copy link
Owner

New flutter projects such as pdfrx's example already has the following gradle version. Not affected by the gradle issue anyway.

distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

@espresso3389
Copy link
Owner

0.4.37 contains the fix explained above:

// Invoke the shared CMake build with the Android Gradle Plugin.
externalNativeBuild {
cmake {
version "3.18.1+"
path "CMakeLists.txt"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants