Gradle Build Android Project “Could not resolve all dependencies” error

后端 未结 12 2014
孤街浪徒
孤街浪徒 2020-12-07 18:00

I\'m trying to build my first project with Gradle and I think my gradle files and settings are correct.

I\'m using only one module and Support V4 + AppCompatBar libr

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 18:46

    If you are running on headless CI and are installing the Android SDK through command line, make sure to include the m2repository packages in the --filter argument:

    android update sdk --no-ui --filter platform-tools,build-tools-19.0.1,android-19,extra-android-support,extra-android-m2repository,extra-google-m2repository
    

    Update

    As of Android SDK Manager rev. 22.6.4 this does not work anymore. Try this instead:

    android list sdk --all
    

    You will get a list of all available SDK packages. Look up the numerical values of the components from the first command above ("Google Repository" and others you might be missing).

    Install the packages using their numerical values:

    android update sdk --no-ui --all --filter 
    

    Update #2 (Sept 2017)

    With the "new" Android SDK tools that were released earlier this year, the android command is now deprecated, and similar functionality has been moved to a new tool called sdkmanager:

    List installed components:

    sdkmanager --list
    

    Update installed components:

    sdkmanager --update
    

    Install a new component (e.g. build tools version 26.0.0):

    sdkmanager 'build-tools;26.0.0'
    

提交回复
热议问题