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

Android Gradle error resolving modules #5847

Closed
unclejay80 opened this issue Sep 21, 2022 · 1 comment
Closed

Android Gradle error resolving modules #5847

unclejay80 opened this issue Sep 21, 2022 · 1 comment
Labels
analyzer About the analyzer tool duplicate An issue that duplicates another issue

Comments

@unclejay80
Copy link
Contributor

Got several errors with an Android project ( https://github.com/vector-im/element-android ) which has several sub modules:
https://github.com/vector-im/element-android/blob/develop/settings.gradle

The syntax with : in settings.gradle file is pretty standard for android projects but seems to be a problem for ort. The : is refering to subfolders with the same name.

Maybe it makes sense to ignore the settings.gradle file for android projects because it just some sort of top level project file (https://developer.android.com/studio/build#settings-file)

Here is the log:

20:37:28.643 [DefaultDispatcher-worker-2] ERROR org.ossreviewtoolkit.analyzer.managers.utils.GradleDependencyHandler - Unresolved: ModuleVersionResolveException: Could not resolve project :matrix-sdk-android.
Caused by: AmbiguousConfigurationSelectionException: The consumer was configured to find a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of project :matrix-sdk-android:
  - debugApiElements
  - releaseApiElements
All of them match the consumer attributes:
  - Variant 'debugApiElements' capability project:matrix-sdk-android:unspecified declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Provides attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.1.0' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
  - Variant 'releaseApiElements' capability project:matrix-sdk-android:unspecified declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Provides attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.1.0' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
          - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
20:37:28.643 [DefaultDispatcher-worker-2] ERROR org.ossreviewtoolkit.analyzer.managers.utils.GradleDependencyHandler - Unresolved: ModuleVersionResolveException: Could not resolve project :matrix-sdk-android-flow.
Caused by: AmbiguousConfigurationSelectionException: The consumer was configured to find a usage of 'kotlin-api' of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of project :matrix-sdk-android-flow:
  - debugApiElements
  - releaseApiElements
All of them match the consumer attributes:
  - Variant 'debugApiElements' capability project:matrix-sdk-android-flow:unspecified declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Provides attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.1.0' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
  - Variant 'releaseApiElements' capability project:matrix-sdk-android-flow:unspecified declares an API of a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Provides attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.1.0' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'release' but the consumer didn't ask for it
          - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
java.lang.IllegalArgumentException: An identifier's properties must not contain ':' because that character is used as a separator in the string representation: type='Unknown', namespace='<project>', name='library:jsonviewer', version=''.
	at org.ossreviewtoolkit.model.Identifier.<init>(Identifier.kt:89)
	at org.ossreviewtoolkit.analyzer.managers.utils.GradleDependencyHandler.identifierFor(GradleDependencyHandler.kt:61)
	at org.ossreviewtoolkit.analyzer.managers.utils.GradleDependencyHandler.identifierFor(GradleDependencyHandler.kt:44)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.addDependencyToGraph(DependencyGraphBuilder.kt:242)
	at org.ossreviewtoolkit.model.utils.DependencyGraphBuilder.addDependency(DependencyGraphBuilder.kt:152)
	at org.ossreviewtoolkit.analyzer.managers.Gradle$resolveDependencies$3.invoke(Gradle.kt:248)
	at org.ossreviewtoolkit.analyzer.managers.Gradle$resolveDependencies$3.invoke(Gradle.kt:193)
	at org.ossreviewtoolkit.utils.common.UtilsKt.temporaryProperties(Utils.kt:129)
	at org.ossreviewtoolkit.analyzer.managers.Gradle.resolveDependencies(Gradle.kt:193)
	at org.ossreviewtoolkit.analyzer.PackageManager.resolveDependencies(PackageManager.kt:264)
	at org.ossreviewtoolkit.analyzer.PackageManagerRunner$run$3.invokeSuspend(Analyzer.kt:322)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
20:37:28.684 [DefaultDispatcher-worker-2] ERROR org.ossreviewtoolkit.analyzer.PackageManager - Resolving Gradle dependencies for path 'vector/build.gradle' failed with: IllegalArgumentException: An identifier's properties must not contain ':' because that character is used as a separator in the string representation: type='Unknown', namespace='<project>', name='library:jsonviewer', version=''.
@sschuberth
Copy link
Member

Duplicates #4694.

@sschuberth sschuberth added duplicate An issue that duplicates another issue analyzer About the analyzer tool labels Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool duplicate An issue that duplicates another issue
Projects
None yet
Development

No branches or pull requests

2 participants