espresso3389 / pdfrx

pdfrx is yet another PDF viewer implementation that built on the top of PDFium. The plugin currently supports Android, iOS, Windows, macOS, Linux, and Web.
MIT License
112 stars 54 forks source link

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

Closed spring321 closed 9 months ago

spring321 commented 9 months ago

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.

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 commented 9 months ago

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...

https://github.com/espresso3389/pdfrx/blob/ee3494c26e192bc91773246bc95e7375ad6559b9/android/build.gradle#L45

espresso3389 commented 9 months ago

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

espresso3389 commented 9 months ago

flutter/flutter #75600 seems very similar.

espresso3389 commented 9 months ago

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

espresso3389 commented 9 months ago

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

https://github.com/espresso3389/pdfrx/blob/7ee94db883de777dbaf55cf9ade7f786b115f68b/example/android/gradle/wrapper/gradle-wrapper.properties#L5

espresso3389 commented 9 months ago

0.4.37 contains the fix explained above:

https://github.com/espresso3389/pdfrx/blob/755e65ff3c19d776619f73060dca6728d60d7fb5/android/build.gradle#L42-L48