Gradle error: configuration declares dependency which is not declared

前端 未结 5 1327
悲哀的现实
悲哀的现实 2020-12-05 18:31

I\'m making my first android wear app, but I can\'t get Android Studio working. First I got the error

 \"Project with path \':wear\' could not be found in pr         


        
5条回答
  •  难免孤独
    2020-12-05 19:10

    In Android Studio 3.0 the documentation for Migrate to the New Plugin says:

    dependencies {
        // This is the old method and no longer works for local
        // library modules:
        // debugCompile project(path: ':foo', configuration: 'debug')
        // releaseCompile project(path: ':foo', configuration: 'release')
    
        // Instead, simply use the following to take advantage of
        // variant-aware dependency resolution. You can learn more about
        // the 'implementation' configuration in the section about
        // new dependency configurations.
        implementation project(':foo')
    
        // You can, however, keep using variant-specific configurations when
        // targeting external dependencies. The following line adds 'app-magic'
        // as a dependency to only the 'debug' version of your module.
    
        debugImplementation 'com.example.android:app-magic:12.3'
    }
    

    So change this

        debugCompile project(path: ':foo', configuration: 'debug')
        releaseCompile project(path: ':foo', configuration: 'release')
    

    to this

        implementation project(':foo')
    

提交回复
热议问题