Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Project with path ':vendinglibrary' could not be found in root project 'gradleOut'.

Discussion in 'Getting Started' started by TomatoesLZH, Feb 5, 2020.

  1. TomatoesLZH

    TomatoesLZH

    Joined:
    Feb 5, 2020
    Posts:
    1
    I am trying to use android studio as a library for Unity. However i am having this error where they can detect my library. This is my folders.

    upload_2020-2-5_10-44-26.png

    This is the error code
    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed.
    2. C:/Program Files/Unity/Hub/Editor/2019.2.17f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2019.2.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
    3.  
    4. stderr[
    5.  
    6. FAILURE: Build completed with 2 failures.
    7.  
    8. 1: Task failed with an exception.
    9. -----------
    10. * Where:
    11. Build file 'C:\Users\L33529.NYPSIT\My_Plugin\Temp\gradleOut\build.gradle' line: 31
    12.  
    13. * What went wrong:
    14. A problem occurred evaluating root project 'gradleOut'.
    15. > Project with path ':vendinglibrary' could not be found in root project 'gradleOut'.
    16.  
    17. * Try:
    18. 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.
    19. ==============================================================================
    20.  
    21. 2: Task failed with an exception.
    22. -----------
    23. * What went wrong:
    24. A problem occurred configuring root project 'gradleOut'.
    25. > compileSdkVersion is not specified.
    26.  
    27. * Try:
    28. 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.
    29. ==============================================================================
    30.  
    31. * Get more help at https://help.gradle.org
    32.  
    33. BUILD FAILED in 1s
    34. ]
    35. stdout[
    36.  
    37. ]
    38. exit code: 1
    39. UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    40. UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    41. UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    42. UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    43. UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    44. Rethrow as GradleInvokationException: Gradle build failed
    45. UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    46. UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    47. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    48. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    49. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    50. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    51. UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    52. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <502f1b7df2d7430696af84c6f02852ed>:0)
    53. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    54. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    55.  


    And this is my gradle
    Code (CSharp):
    1. buildscript {
    2.     repositories {**ARTIFACTORYREPOSITORY**
    3.         google()
    4.         jcenter()
    5.     }
    6.  
    7.     dependencies {
    8.         classpath 'com.android.tools.build:gradle:3.4.0'
    9. **BUILD_SCRIPT_DEPS**}
    10. }
    11.  
    12. allprojects {
    13.     repositories {**ARTIFACTORYREPOSITORY**
    14.         google()
    15.         jcenter()
    16.         flatDir {
    17.             dirs 'libs'
    18.         }
    19.     }
    20. }
    21.  
    22. apply plugin: 'com.android.application'
    23. **APPLY_PLUGINS**
    24.  
    25. dependencies {
    26.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    27.     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61"
    28.     implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.2'
    29.     implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.2'
    30.    
    31.     implementation project(":vendinglibrary")  
    32. **DEPS**}
    33.  
    34. android {
    35.     compileSdkVersion **APIVERSION**
    36.     buildToolsVersion '**BUILDTOOLS**'
    37.  
    38.     compileOptions {
    39.         sourceCompatibility JavaVersion.VERSION_1_8
    40.         targetCompatibility JavaVersion.VERSION_1_8
    41.     }
    42.  
    43.     defaultConfig {
    44.         minSdkVersion **MINSDKVERSION**
    45.         targetSdkVersion **TARGETSDKVERSION**
    46.         applicationId '**APPLICATIONID**'
    47.         ndk {
    48.             abiFilters **ABIFILTERS**
    49.         }
    50.         versionCode **VERSIONCODE**
    51.         versionName '**VERSIONNAME**'
    52.     }
    53.  
    54.     lintOptions {
    55.         abortOnError false
    56.     }
    57.  
    58.     aaptOptions {
    59.         noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
    60.         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    61.     }**SIGN**
    62.  
    63.     buildTypes {
    64.         debug {
    65.             minifyEnabled **MINIFY_DEBUG**
    66.             useProguard **PROGUARD_DEBUG**
    67.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
    68.             jniDebuggable true
    69.         }
    70.         release {
    71.             minifyEnabled **MINIFY_RELEASE**
    72.             useProguard **PROGUARD_RELEASE**
    73.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'**USER_PROGUARD****SIGNCONFIG**
    74.         }
    75.     }**PACKAGING_OPTIONS****SPLITS**
    76. **BUILT_APK_LOCATION**
    77.  
    78. **EXTERNAL_SOURCES**
    79.     bundle {
    80.         language {
    81.             enableSplit = false
    82.         }
    83.         density {
    84.             enableSplit = false
    85.         }
    86.         abi {
    87.             enableSplit = true
    88.         }
    89.     }
    90. }**SPLITS_VERSION_CODE****REPOSITORIES****SOURCE_BUILD_SETUP**
    91.  

    What is my problem here, how do i make unity detect the library Am i missing the setting.gradle file? If i am, where do i put it and what do i put in it. Since Settings.gradle is not created by Unity, i am not sure how do i do it.
     
  2. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    234
    Did you get a resolution to this? We're experiencing a similar issue, we've tried reactoring to using all the new gradles to no avail.

     
  3. Namke

    Namke

    Joined:
    Mar 21, 2013
    Posts:
    6
    Check if your project contain mainTemplate.gradle or some .gradle files, remove it and try compile again.