cocoscreator構建的android工程報錯

cocoscreator構建的安卓項目打包報錯:
Error:The module 'libcocos2dx' is an Android project without build variants, and cannot be built. Please fix the module’s configuration in the build.gradle file and sync the project again.
Error:The module 'xxx' is an Android project without build variants, and cannot be built. Please fix the module’s configuration in the build.gradle file and sync the project again.

我的環境都是ok的,java環境裝了,ndk配置了,android sdk也配置了,不知道這個報錯什麼原因。

網上找了一圈,基本上都是說gradle版本不對,或者沒有下載下來,或者是手動添加debug/release configuration。照着網上的方法都試了一遍,依然報錯。

最後,博主發現這個是project structure的錯誤,就在project structure面板裏面去找原因,果然發現NDK沒有配置。點擊下載,完成之後開始自動同步,一切完事之後世界清淨了,不報錯了。

所以就是NDK的鍋,我在cocoscreator裏面配置了NDK的,既然無用爲什麼讓我配置。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章