Unable to resolve dependency Android Studio 3.0

前端 未结 10 468
一整个雨季
一整个雨季 2020-12-04 21:38

It\'s good to have a Updated Android Studio 3.0. But I am facing a problem with Android Studio 3.0, I just created a new project in

相关标签:
10条回答
  • 2020-12-04 22:17

    Short story:

    Downgrade to Gradle 4.2.1

    Long story:

    I was using Gradle version 4.3 based on the answer here as that question was my error. After doing that change than I started having your problem.

    Downgrading to version 4.2.1 your problem went away. Now I have to go back to the previous problem.

    I also had this problem while compiling my project with Android Studio 3.0 and gradle plugin 3.0.0

    If I will have other problems I will post here the updates

    0 讨论(0)
  • 2020-12-04 22:19

    I solve this problem by clearing this directory:

    c:\Users\User name\\.gradle\caches\
    
    0 讨论(0)
  • 2020-12-04 22:19

    Had the same issue. After trying everything, finally realized that it was the network that didn't allow syncing dependencies. Tried out with hotspot and it worked.

    0 讨论(0)
  • 2020-12-04 22:20

    I had the same issue and I solved it by changing apply plugin: 'com.android.application' to apply plugin: 'com.android.library'

    Regarding my issue, it was a little bit different from yours. I have the second module with android library and from android developers page under the section "Convert an app module to a library module". My guess is that it is related to managing Manifest files inside of the architecture, so Android will know where is the main Manifest file.

    And regarding api and implementation, the answer can be found here

    The api configuration should be used to declare dependencies which are exported by the library API, whereas the implementation configuration should be used to declare dependencies which are internal to the component.

    0 讨论(0)
  • 2020-12-04 22:22

    Downgrade these two files solve the problem

    project`s build.graddle to 3.1.4 graddle-wrapper properties to 4.4

    0 讨论(0)
  • 2020-12-04 22:30

    After some research I have solved this issue.

    Step 1-:

    I disable the Gradle offline work in settings.

    File > Settings > Build, Execution, Deployment > Gradle > Uncheck Offline Work

    Step 2-:

    Then, I just changed compile 'com.facebook.android:account-kit-sdk:4.+' to api 'com.facebook.android:account-kit-sdk:4.+'

    I don't know exactly why it's work. I see api in docs Reference

    Now it works :)

    EDIT -

    Now, I am able to use both api or implementation and everything works fine.

    Thanks,

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