Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find a matching variant of project :UnityExport: , Working in debug but not as release #52

Closed
TarekMedhat opened this issue Sep 22, 2019 · 1 comment

Comments

@TarekMedhat
Copy link

The project is working fine with "flutter run" in debug mode.

But getting an error when trying to run "flutter run --release" or generating the apk "flutter build apk --release"

running as release results the following exception or build apk:
`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 :UnityExport.
Required by:
project :flutter_unity_widget
> Unable to find a matching variant of project :UnityExport:
- Variant 'debugApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'profile' and found incompatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
- Variant 'debugRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'profile' and found incompatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
- Variant 'releaseApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'profile' and found incompatible value 'release'.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
- Variant 'releaseRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'profile' and found incompatible value 'release'.
- Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
`

@TarekMedhat
Copy link
Author

TarekMedhat commented Sep 22, 2019

#Solved by adding
buildTypes { //... // profile { matchingFallbacks = ['debug', 'release'] } }
to UnityExport project build.gradle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant