Getting could not resolve project unityLibrary error
Hi guys !
Been trying to fix this error on my own and after countless hours of research i still havent managed to solve this one could you guys help me solve it please ?
A pic of the error list:

Thanks in advance guys !
Can you experiment with the buildType attributes in you build.gradle files?
This should be placed inside the android { } element.
android/app/build.gradle should have a signingConfig defined.
This is probably already (partially) there.
buildTypes {
release {
// .release if you have a keystore setup
signingConfig signingConfigs.debug
}
debug {
signingConfig signingConfigs.debug
}
profile {
signingConfig signingConfigs.debug
}
innerTest {
matchingFallbacks = ['debug', 'release']
}
}
Sometimes you need to add matching elements to the unity gradle AFTER an export from Unity. https://github.com/juicycleff/flutter-unity-view-widget/issues/527#issuecomment-1028858458
android/unityLibrary/build.gradle
buildTypes {
release {
}
debug {
}
profile {
}
innerTest {
matchingFallbacks = ['debug', 'release']
}
}
Profile and innerTest can likely be omitted in both if you don't use them.
I tried replacing that in the app level build.gradle but did not work.
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Documents/flutter/flutter-unity-view-widget/example$ flutter run
Launching lib/main.dart on A202ZT in debug mode...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve project :unityLibrary.
Required by:
project :app
> No matching configuration of project :unityLibrary was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
* 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
BUILD FAILED in 984ms
Running Gradle task 'assembleDebug'... 1,467ms
Exception: Gradle task assembleDebug failed with exit code 1
Can you experiment with the buildType attributes in you build.gradle files? This should be placed inside the
android { }element.
android/app/build.gradleshould have a signingConfig defined. This is probably already (partially) there.buildTypes { release { // .release if you have a keystore setup signingConfig signingConfigs.debug } debug { signingConfig signingConfigs.debug } profile { signingConfig signingConfigs.debug } innerTest { matchingFallbacks = ['debug', 'release'] } }Sometimes you need to add matching elements to the unity gradle AFTER an export from Unity. #527 (comment)
android/unityLibrary/build.gradlebuildTypes { release { } debug { } profile { } innerTest { matchingFallbacks = ['debug', 'release'] } }Profile and innerTest can likely be omitted in both if you don't use them.
If need to support profile mode, also add the above buildTypes to 'android/unityLibrary/xrmanifest.androidlib/build.gradle'
buildTypes { release { } debug { } profile { } innerTest { matchingFallbacks = ['debug', 'release'] } }
Sometimes, check if you have created the folder but hasn't exported from unity, to me it was that.