LoginSignup
0
1

More than 5 years have passed since last update.

CocosCreator でAndroidで Build->Compile でエラーが起きた時に行った対処

Posted at

概要

CocosCreatorで実機ビルドする際にiOSはそのまま"Project"->"Build..."で"Platform"をiOSに変更してビルドすれば上手くいくがAndroidではエラーがでたのでハマった部分を記載

Androidビルド設定

基本的な事だが"Preference"->"Native Develop"で"NDK Root"と"Android SDK Root"を設定する。のはAndroid Studio をインストールしてその時インストールしたSDKとNDKの場所を指定している

エラー内容

"Error: Compile failed. The log file path"とでてログファイルの場所を見に行くと以下のようなエラーが出た

native.log
Building mode: release
Using Android Studio project : /Users/{user.name}/proj/private/ccSample/start_project/build/jsb-link/frameworks/runtime-src/proj.android-studio
Building apk...
running: '"/Users/{user.name}/proj/private/ccSample/start_project/build/jsb-link/frameworks/runtime-src/proj.android-studio/gradlew" --parallel --info assembleRelease'

Initialized native services in: /Users/{user.name}/.gradle/native

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
Error running command, return code: 1.

gradleまわりが怪しいので一度AndroidStudioでプロジェクトのbuild/jsb-link/frameworks/runtime-src/prj.android-studioを開いたら依存関係を解決してくれるのでその後で再度ビルドすると成功する

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1