flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

Error when Build an APK for Android

Open kepinpinn opened this issue 3 years ago • 2 comments

I just trying to build my projects into APK, but it failed. What should i do?

This is error in terminal:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:lintVitalRelease'.

Could not resolve all artifacts for configuration ':flutter_unity_widget:profileRuntimeClasspath'. Could not resolve project :unityLibrary. Required by: project :flutter_unity_widget > No matching variant of project :unityLibrary was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but: - Variant 'debugApiElements' capability android:unityLibrary:unspecified: - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile' - Other compatible attribute: - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm') - Variant 'debugRuntimeElements' capability android:unityLibrary:unspecified declares a runtime of a component: - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a compone - Other compatible attribute: - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm') - Variant 'releaseApiElements' capability android:unityLibrary:unspecified: - Incompatible because this component declares an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a runtime of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile' - Other compatible attribute: - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm') - Variant 'releaseRuntimeElements' capability android:unityLibrary:unspecified declares a runtime of a component: - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile' - Other compatible attribute: - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

  • 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

kepinpinn avatar May 28 '22 19:05 kepinpinn

Need to open the unit project and import FlutterUnityPackage.unitypckage, and then export "Flutter"->"Export Android"

XuTuKe avatar May 28 '22 22:05 XuTuKe

Have you followed all the steps in the readme?

jamesncl avatar May 29 '22 10:05 jamesncl