NIFCLOUD-mbaas / UserCommunity

ニフクラ mobile backend ユーザーコミュニティ
https://mbaas.nifcloud.com/
81 stars 18 forks source link

Build Failure with Gradle #1082

Open botamochi6277 opened 4 years ago

botamochi6277 commented 4 years ago

I fail to build my application for Android(Oculus Quest) with Gradle.

I added basic NCMB functions according to Quick Start Guide.

My application works well in the unity scene view.

Following error messages appeared when I built. Should I edit gradle settings?

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/Users/botamochi/GitRep/swordtrial/Temp/gradleOut/build.gradle' line: 43

* What went wrong:
A problem occurred evaluating root project 'gradleOut'.
> Project with path ':unity-android-resources' could not be found in root project 'gradleOut'.

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

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring root project 'gradleOut'.
> compileSdkVersion is not specified.

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

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

My Environment OS: MacOS Mojave 10.14.5 Unity: 2019.2.12f1 Personal AndroidSDK build-tools : 28.0.3(Unity android build support) NCMB: 4.0.3

goofmint commented 4 years ago

I can't understand this error message was occurred by NCMB.

> Project with path ':unity-android-resources' could not be found in root project 'gradleOut'.

Can you success building your project if you removed NCMB libraly and code?

botamochi6277 commented 4 years ago

I succeeded building my application before importing NCMB library.
I did only add NCMB library and the Quick Start Guide. I use default Gradle Settings, do not use Custom Gradle Template.

goofmint commented 4 years ago

Could you check your line #42-44 in your gradle file? It's temporary file, so perhaps the Unity builder will remove it automatically.

/Users/botamochi/GitRep/swordtrial/Temp/gradleOut/build.gradle' line: 43
botamochi6277 commented 4 years ago

Line 43 of "/Temp/gradleOut/build.gradle" is implementation project(':unity-android-resources'). Unity may makes this file automatically every building. Does NCMB library hide ':unity-android-resources' from 'gradleOut'?

botamochi6277 commented 4 years ago

I succeeded in building with removing mainTemplate.gradle and settingsTemplate.gradle. Although I unchecked Custom Gradle Template in project settings, Unity builder may use custom gradle settings.