coolishbee / universal-sdk-unity

The Universal SDK for Unity provides a modern way of implementing Social Login APIs.
45 stars 11 forks source link

Unable to build in Unity 2022.2.21 #20

Closed davidfio closed 1 year ago

davidfio commented 1 year ago

When I try to build Android in Unity 2022.2.21 I received this error:

`Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

> Configure project :
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by build file 'build.gradle'
Build was configured to prefer settings repositories over project repositories but repository 'flatDir' was added by build file 'build.gradle'

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings`

`Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
FAILURE: Build failed with an exception.

* Where:
Build file '/Users/massamagra/Desktop/UniversalSDK-Test/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin 'com.android.internal.version-check'.
   > Cannot parse project property android.enableR8='' of type 'class java.lang.String' as boolean. Expected 'true' or 'false'.

* 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
`

I tried to follow the links but I failed to build again. In Unity 2021.3.25 it works great. I'm using Universal SDK 1.2.3 and I'm on Mac with Apple Silicon.

coolishbee commented 1 year ago

Tested in unity 2022.3 Do not use .gradle files from other Unity versions, create them in unity2022.3 (create custom template)

baseProjectTemplate.gradle :

plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.3.72' apply false
    **BUILD_SCRIPT_DEPS**
}

mainTemplate.gradle :

apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android' //added
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'io.github.coolishbee:universalsdk:3.0.5' //added
    implementation 'com.google.code.gson:gson:2.8.5' //added

**DEPS**}

For more information, please refer to the documentation.

Thanks!