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

后端 未结 11 1923

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条回答
  •  猫巷女王i
    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.

提交回复
热议问题