openkraken / kraken

A web standards-compliant, high-performance rendering engine based on Flutter.
https://openkraken.com
Apache License 2.0
4.93k stars 305 forks source link

编译失败:npm run build:bridge:android #1348

Open Z644912187 opened 2 years ago

Z644912187 commented 2 years ago

使用的 Kraken 版本 | What version of kraken are you using

commit 5f658850ef41ebbc608e448b4f8fdd3f3aa75076

重现步骤 | Steps To Reproduce

已按kraken文档安装好相应环境

➜  kraken git:(main) ✗ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.64.2)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

执行命令:npm run build:bridge:android

预期结果 | Expected results: 正常编译bridge

实际结果 | Actual results:

kraken git:(main) npm run build:bridge:android

build:bridge:android
node scripts/build_android_so

build
NODE_ENV=development rollup --config rollup.config.js && npm run mainToC && npm run testToC

src/index.ts → dist/main.js...
Created bundle main.js: 87.6 kB → 17.03 kB (gzip)
created dist/main.js in 2.7s

src/test/index.js → dist/test.js...
Created bundle test.js: 255.04 kB → 51.27 kB (gzip)
created dist/test.js in 743ms

mainToC
node scripts/js_to_c.js -s ../dist/main.js -o ../dist

testToC
node scripts/js_to_c.js -s ../dist/test.js -o ../dist -n TestFramework

-- Check for working C compiler: /Users/feizhu/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang
-- Check for working C compiler: /Users/feizhu/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Users/feizhu/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++
-- Check for working CXX compiler: /Users/feizhu/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done

code_generator@1.0.0 build
tsc

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/feizhu/work/flutter_ws/kraken/bridge
Error: /Users/feizhu/work/flutter_ws/kraken/bridge/cmake-build-android-arm64-v8a is not a directory
/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:18
throw err;
^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
uid: 2,
name: 'build-android-kraken-lib',
branch: false,
error: Error: Command failed: cmake --build /Users/feizhu/work/flutter_ws/kraken/bridge/cmake-build-android-arm64-v8a --target kraken -- -j 12
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:902:15)
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:692:5
at Array.forEach ()
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:666:9
at taskWrapper (/Users/feizhu/work/flutter_ws/kraken/node_modules/undertaker/lib/set-task.js:13:15)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 25044,
stdout: null,
stderr: null,
domainThrown: true
},
duration: [ 9, 674214639 ],
time: 1650809053898
})
at new NodeError (node:internal/errors:371:5)
at Gulp.emit (node:events:515:17)
at Gulp.emit (node:domain:475:12)
at Object.error (/Users/feizhu/work/flutter_ws/kraken/node_modules/undertaker/lib/helpers/createExtensions.js:61:10)
at handler (/Users/feizhu/work/flutter_ws/kraken/node_modules/now-and-later/lib/mapSeries.js:47:14)
at f (/Users/feizhu/work/flutter_ws/kraken/node_modules/once/once.js:25:25)
at f (/Users/feizhu/work/flutter_ws/kraken/node_modules/once/once.js:25:25)
at tryCatch (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:24:15)
at done (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:40:12)
at Domain.onError (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:51:5) {
code: 'ERR_UNHANDLED_ERROR',
context: {
uid: 2,
name: 'build-android-kraken-lib',
branch: false,
error: Error: Command failed: cmake --build /Users/feizhu/work/flutter_ws/kraken/bridge/cmake-build-android-arm64-v8a --target kraken -- -j 12
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:902:15)
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:692:5
at Array.forEach ()
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:666:9
at taskWrapper (/Users/feizhu/work/flutter_ws/kraken/node_modules/undertaker/lib/set-task.js:13:15)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 25044,
stdout: null,
stderr: null,
domainThrown: true
},
duration: [ 9, 674214639 ],
time: 1650809053898
}
}
andycall commented 2 years ago

目录不太对,删除bridge/cmake-*目录

Z644912187 commented 2 years ago

目录不太对,删除bridge/cmake-*目录

删除目录后编译就是这样的结果 @andycall 工程下的确没有这个目录

...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/feizhu/work/flutter_ws/kraken/bridge
Error: /Users/feizhu/work/flutter_ws/kraken/bridge/cmake-build-android-arm64-v8a is not a directory
/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:18
throw err;
^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
uid: 2,
name: 'build-android-kraken-lib',
branch: false,
error: Error: Command failed: cmake --build /Users/feizhu/work/flutter_ws/kraken/bridge/cmake-build-android-arm64-v8a --target kraken -- -j 12
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:902:15)
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:692:5
at Array.forEach ()
at /Users/feizhu/work/flutter_ws/kraken/scripts/tasks.js:666:9
at taskWrapper (/Users/feizhu/work/flutter_ws/kraken/node_modules/undertaker/lib/set-task.js:13:15)
at bound (node:domain:421:15)
at runBound (node:domain:432:12)
at asyncRunner (/Users/feizhu/work/flutter_ws/kraken/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 25044,
stdout: null,
stderr: null,
domainThrown: true
},
duration: [ 9, 674214639 ],
time: 1650809053898
})
wssgcg1213 commented 2 years ago

试着给它创建这个目录之后能正常构建了吗