Android Studio Suddenly started to display unable to resolve com.android.support…25.0.0 error messages and all of my java files are erroneous now?

纵饮孤独 提交于 2019-11-29 05:32:21

Open your android SDK manager (from C:\Users\youruseraccount\AppData\Local\Android\sdk) and update following to latest versions in,

Tools section section

  1. Android SDK Tool

  2. Android SDK Platform-Tools

  3. Android SDK Build tool

Android 7.1.1 (API 25) section

  1. SDK Platform

Extras Section

  1. Android Support Repository
  2. Android Support Library

Then update your gradle file accordingly.

Facebook updated their SDK to use the latest support libraries. You could replace

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

with

compile 'com.facebook.android:facebook-android-sdk:4.16.1'

if you do not want to update your android sdk just yet.

I had the same problem earlier today. Out of nowhere, I started having those weird error messages. Updating:

  1. Android SDK Tool
  2. Android SDK Platform-Tools
  3. Android SDK Build tool
  4. Android Support Repository

did the trick for me. Just go to Tools > Android > SDK Manager in your Android Studio then find and update them. Good luck!

If you try to remove facebook-sdk compile from dependencies will not show that error. So i think is facebook sdk error.

I was using 'com.facebook.android:facebook-android-sdk:[4,5)' but gives error, i tried this com.facebook.android:facebook-android-sdk:4.+ but is the same. But when i remove it app build successfully. Am i the only i came in this conclude and having the same problem ?

if you are using cardview with 25.0.0 version then i think your issue is with your target sdk version. Make it 25 and things should work otherwise downgrade your cardview and other libraries from 25.0.0 to 23.x.x

Just updating the Android support repository version to 25 did my work. Thanks to all of you for the guidance!

If you added the latest Facebook SDK or using + for Facebook dependency, revert to a previous version

compile 'com.facebook.android:facebook-android-sdk:4.16.1'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!