when i'm trying to add project as a module i'm getting this error :
Unable to resolve dependency for ':sample@debug/compileClasspath': Could not resolve project :library.
Could not resolve project :library. Required by: project :sample
Unable to find a matching configuration of project :library: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. - Configuration 'debugMetadataElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Metadata'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.usage 'java-api' but no value provided. - Configuration 'debugRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required. - Required org.gradle.usage 'java-api' and found incompatible value 'java-runtime'. - Configuration 'releaseApiElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.usage 'java-api' and found compatible value 'java-api'. - Configuration 'releaseMetadataElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Metadata'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.usage 'java-api' but no value provided. - Configuration 'releaseRuntimeElements': - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found incompatible value 'release'. - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found incompatible value 'Apk'. - Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required. - Required org.gradle.usage 'java-api' and found incompatible value 'java-runtime'.
i researched SO and the only almost working solution i found is to change the line that im adding the project as module to this :
implementation project(path: ':library', configuration: 'default')
(just adding configuration flag) than the sync worked but i couldn't import an of the project classes to it didn't help me.