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: #40

Closed
allanclempe opened this issue Sep 5, 2019 · 3 comments
Closed

Unable to find a matching variant of project :UnityExport: #40

allanclempe opened this issue Sep 5, 2019 · 3 comments

Comments

@allanclempe
Copy link

Hi there,

Using your example project as a code base, I got the exported unity android project as explained here and copied the output to UnityExport folder. When tried to build gradle I'm getting the following results:


* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :UnityExport.
     Required by:
         project :app > project :flutter_unity_widget
      > Unable to find a matching variant of project :UnityExport:
          - Variant 'debugApiElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible 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 incompatible value 'Apk'.
              - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
          - Variant 'debugBundleElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
              - Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
              - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
              - Required org.gradle.usage 'java-runtime' and found incompatible value 'android-bundle'.
          - Variant 'debugMetadataElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible 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 incompatible value 'Metadata'.
              - Required org.gradle.usage 'java-runtime' but no value provided.
          - Variant 'debugRuntimeElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible 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 incompatible value 'Apk'.
              - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
          - Variant 'releaseApiElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' 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 incompatible value 'Apk'.
              - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
          - Variant 'releaseBundleElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' but no value provided.
              - Found com.android.build.api.attributes.VariantAttr 'release' but wasn't required.
              - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' but no value provided.
              - Required org.gradle.usage 'java-runtime' and found incompatible value 'android-bundle'.
          - Variant 'releaseMetadataElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' 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 incompatible value 'Metadata'.
              - Required org.gradle.usage 'java-runtime' but no value provided.
          - Variant 'releaseRuntimeElements':
              - Required com.android.build.api.attributes.BuildTypeAttr 'debug' 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 incompatible value 'Apk'.
              - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.

Flutter doctor output.

C:\temp\flutter-unity-view-widget-master\example>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.18362.295], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[√] VS Code (version 1.38.0)
[√] Connected device (2 available)

• No issues found!

Any idea what could be the problem?

Thanks.

@juicycleff
Copy link
Owner

Duplicate issue 39

@TarekMedhat
Copy link

#52 #52 (comment)

I'm facing the same issue while running as --release or generating a release apk, but it's working fine as debug version any solutions?

@allanclempe
Copy link
Author

@TarekMedhat I got that solved by removing the following line from the unity game gradle.build file.

dependencies {
   // remove this
   //implementation fileTree(dir: 'libs', include: ['*.jar'])
  
   // keep just this one.
   implementation project(':unity-classes')   
}

lorant-csonka-planorama's commit, 15 days ago, should have fixed that problem though.

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

3 participants