app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project

后端 未结 11 1897

I am importing a library module named \"wear\" in my project and while building, I am getting this:

Error : A problem occurred configuring project \':app\'.   
C         


        
相关标签:
11条回答
  • 2021-02-03 17:48

    Actually the project itself lays inside the target project root folder:

    ...
     |-wear
          |-app
    

    So in order to include it properly you have to define path that points to that inner folder:

    'setting.gradle':

    include ':app', 'MyLibraryProject'
    project(':MyLibraryProject').projectDir = new File("X:\\SOME_PATH\\wear\\app")
    

    'app\build.gradle' (Main project)

    dependencies {
    ...
    compile project(':MyLibraryProject')
    ...
    }
    
    0 讨论(0)
  • 2021-02-03 17:49

    I recently encountered such a problem, when I was in the window10 compiler no problem, but I compiled a problem in Linux, I think this reason with the platform, I checked and found that my project name is with the case Named, and then I unified named lowercase letters, and then build, found successful. ^ _ ^.

    0 讨论(0)
  • 2021-02-03 17:55

    This error usually occurs when Gradle cannot find a particular component. I experienced this when trying to use the Salesforce React Native Android example.

    The error message you get looks like the one you posted ... in my case it was

    Project :app declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :libs:SalesforceReact.
    

    I found my Gradle settings file ( called settings.gradle ) in the projects android directory. The start of it looked like this

    rootProject.name = 'SmartSyncExplorerReactNative'
    
    def libsRootDir = new File( settingsDir, '../node_modules/SalesforceMobileSDK-Android/libs' )
    include ':app'
    
    include ':libs:SalesforceReact'
    project( ':libs:SalesforceReact' ).projectDir = new File( libsRootDir, 'SalesforceReact' )
    

    In this case, the path given in libsRootDir did not exist (as these libraries actually came from a different repository which I cloned and then pointed this path to!).

    Once I had corrected the path, save the settings file and reran, everything worked smoothly.

    I hope this helps, Jonathan.

    0 讨论(0)
  • 2021-02-03 17:59

    I found this error too. So, I noticed that my settings.gradle was searching for a path that didn't exist. Example: (settings.gradle)

    project(':YourProjectV1').projectDir = new File('../YourProjectFolderV1/app/');
    

    However, in my filesystem, the path was: ../YourProjectFolderv1

    After syncing the names, the project was ok!

    I hope that helps.

    0 讨论(0)
  • 2021-02-03 18:02

    I actually just needed to add the submodule so I ran the following git commands in terminal:

    git submodule init git submodule update and then a rebuild!

    0 讨论(0)
  • 2021-02-03 18:03

    I ran into this errors too, it turns out that there are a library path changed. Im using react-native-maps version 1.4

    In settings.gradle change the react-native-maps dependency path to

    ... include ':react-native-maps' project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')

    It seems to me the installation manual is not updated

    0 讨论(0)
提交回复
热议问题