line/line-sdk-unity

Error : No variants found for 'unityLibrary'. Check build files to ensure at least one variant exists.

ZigZag1120 opened this issue · 5 comments

Is it a security issue?

No

What did you do?

I create a new unity project and follow the steps in the document to integrate sdk.
Exporting as an android project and open it with Android studio.

What did you expect?

Exporting android project , and build into apk to test my integration.

What happened actually?

I got "No variants found for 'unityLibrary'. Check build files to ensure at least one variant exists." Error.

Your environment?

Unity 2020.3.18f1
line_sdk_unity_1.1.6
Android Studio 4.1.1

Sample project

Here is the download link : https://drive.google.com/file/d/1lybB9JR6NHY7kK0QuwOxNoRS3OP6I5zx/view?usp=sharing

I tried your project and it exports/compiles/runs without problem. So it should be an environment thing.

Does this post help? Please make sure you have the matched compileSdkVersion installed on your machine and let SDK Manager finds it correctly.

Best regards.

Thanks for the reply!
I've checked sdk manager and have the right SDK platform installed in it.
After trying to find the problem , I found that if I remove "classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"" in the build.gradle in unityLibrary , the error will disappear.
So , I think it's something to do with Kotlin environment.
I checked my Kotlin plugin in android studio, the version is 1.3.72. It seems that 1.3.72 is the lowest version in Android Studio 4.1.1, because I can't downgrade to 1.3.11 to fit the version in build.gradle.
I've tried change the version in build.gradle to fit the version installed in my Android Studio, but still in vain.
That's I've tried till now , hope there's any useful information above.
Thanks.

@plateaukao Do you have any comment on this? Or should be try to upgrade the Kotlin version required in this package?

Sorry for disturbing you again.

After trying and searching about environment setting these days , I found that uncheck the "Only sync active variant" in "Preferences -> Experimental" did the trick.

By the way , I need to add "IL_CPP_BUILD_SETUP" in the end of the mainTemplate.gradle to avoid crashing at the start of the app. It seems like to be the issue when migrate gradle file from 2019 to 2020 from the article here.(IL_CPP_BUILD_SETUP)

Thanks for the support!

@ZigZag1120

Thanks for the feedback! So it seems not to be related to LINE SDK Unity asset. I am closing it for now.

We will also try to keep an eye on the "Only sync active variant" to see if it affects more users and consider a note in the installation guide.

Thank you!