Unable to resolve dependency Android Studio 3.0
I am facing similar error day before yesterday. Just solved it here
Moreover, as mentioned in the latest gradle release notes , you should avoid using dynamic dependencies with version number as:
com.facebook.android:account-kit-sdk:4.+
Try to replace it with appropriate version number as 4.0.0 or latest. Hope it solves the problem.
Add matchingFallbacks = ['release', 'debug']
in the buildType
that is failing to compile.
E.g. I was having an error for releaseStaging
:
buildTypes {
debug {
buildConfigField "String", "CODEPUSH_KEY", '""'
}
releaseStaging {
buildConfigField "String", "CODEPUSH_KEY", 'myKey'
signingConfig signingConfigs.release
matchingFallbacks = ['release', 'debug']
}
release {
buildConfigField "String", "CODEPUSH_KEY", 'myKey'
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
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,
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