利用craetor的项目发布android编译过程报错

sadizance
Thu, 11 Jan 2018 03:34:20 +0000

Creator 版本：windows-1.8.0

目标平台： Android

报错信息：

D
:/Android/sdk/ndk-bundle/build//…/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin/ld.exe: error: D:/Android/sdk/ndk-bundle/build//…/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/…/libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin-0.dll: could not load plugin library
: ???
collect2.exe: error: ld returned 1 exit status
make: *** [D:/Cocos/cocosProjects/start_project/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so] Error 1
:start_project:externalNativeBuildRelease FAILED
:start_project:externalNativeBuildRelease (Thread[Task worker for ‘:’,5,main]) completed. Took 1 mins 12.29 secs.

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘:start_project:externalNativeBuildRelease’.

Build command failed.
Error while executing process D:\Android\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\Cocos\cocosProjects\start_project\build\jsb-binary\frameworks\runtime-src\proj.android-studio\app\jni\Android.mk NDK_APPLICATION_MK=D:\Cocos\cocosProjects\start_project\build\jsb-binary\frameworks\runtime-src\proj.android-studio\app\jni\Application.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=0 APP_PLATFORM=android-14 NDK_OUT=D:/Cocos/cocosProjects/start_project/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj NDK_LIBS_OUT=D:\Cocos\cocosProjects\start_project\build\jsb-binary\frameworks\runtime-src\proj.android-studio\app\build\intermediates\ndkBuild\release\lib NDK_TOOLCHAIN_VERSION=4.9 APP_PLATFORM=android-24 NDK_MODULE_PATH=D:\Cocos\CocosCreator\resources\cocos2d-x;D:\Cocos\CocosCreator\resources\cocos2d-x\cocos;D:\Cocos\CocosCreator\resources\cocos2d-x\external -j4 NDK_DEBUG=0 D:/Cocos/cocosProjects/start_project/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so}
[armeabi-v7a] Compile++ arm : cocos2djs_shared <= AppDelegate.cpp
[armeabi-v7a] Compile++ arm : cocos2djs_shared <= main.cpp
[armeabi-v7a] Compile++ arm : cocos2djs_shared <= jsb_module_register.cpp
[armeabi-v7a] Compile arm : vorbisidec <= bitwise.c
[armeabi-v7a] Compile arm : vorbisidec <= codebook.c
[armeabi-v7a] Compile arm : vorbisidec <= dsp.c
[armeabi-v7a] Compile arm : vorbisidec <= floor0.c
[armeabi-v7a] Compile arm : vorbisidec <= floor1.c
[armeabi-v7a] Compile arm : vorbisidec <= floor_lookup.c
[armeabi-v7a] Compile arm : vorbisidec <= framing.c
[armeabi-v7a] Compile arm : vorbisidec <= mapping0.c
[armeabi-v7a] Compile arm : vorbisidec <= mdct.c
[armeabi-v7a] Compile arm : vorbisidec <= misc.c
[armeabi-v7a] Compile arm : vorbisidec <= res012.c
[armeabi-v7a] Compile arm : vorbisidec <= treminfo.c
[armeabi-v7a] Compile arm : vorbisidec <= vorbisfile.c
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_normalize.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_alias_reduction.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_crc.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_decode_header.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_decode_huff_cw.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_getbits.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_dequantize_sample.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_framedecoder.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_get_main_data_size.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_get_side_info.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_get_scale_factors.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_mpeg2_get_scale_data.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_mpeg2_get_scale_factors.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_mpeg2_stereo_proc.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_huffman_decoding.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_huffman_parsing.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_tables.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_imdct_synth.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_mdct_6.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_dct_6.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_poly_phase_synthesis.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_equalizer.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_seek_synch.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_stereo_proc.cpp
[armeabi-v7a] Compile++ arm : pvmp3dec <= pvmp3_reorder.cpp
[armeabi-v7a] Compile arm : pvmp3dec <= pvmp3_polyphase_filter_window_gcc.s
[armeabi-v7a] Compile arm : pvmp3dec <= pvmp3_mdct_18_gcc.s
[armeabi-v7a] Compile arm : pvmp3dec <= pvmp3_dct_9_gcc.s
[armeabi-v7a] Compile arm : pvmp3dec <= pvmp3_dct_16_gcc.s
[armeabi-v7a] Compile thumb : cpufeatures <= cpu-features.c
[armeabi-v7a] StaticLibrary : libvorbisidec.a
[armeabi-v7a] StaticLibrary : libpvmp3dec.a
[armeabi-v7a] StaticLibrary : libcpufeatures.a
[armeabi-v7a] SharedLibrary : libcocos2djs.so
D:/Android/sdk/ndk-bundle/build//…/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/…/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin/ld.exe: error: D:/Android/sdk/ndk-bundle/build//…/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/…/libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin-0.dll: could not load plugin library: ???

collect2.exe: error: ld returned 1 exit status
make: *** [D:/Cocos/cocosProjects/start_project/build/jsb-binary/frameworks/runtime-src/proj.android-studio/app/build/intermediates/ndkBuild/release/obj/local/armeabi-v7a/libcocos2djs.so] Error 1

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

Get more help at https://help.gradle.org

BUILD FAILED in 1m 59s
48 actionable tasks: 48 executed
执行命令出错，返回值：1。

感觉应该是我的ndk问题，我的ndk是android studio内部sdkManager下载的，Android Studio是3.0.1，ndk是16

阅读整个主题