20

私のプロジェクトは非常にうまくいっていましたが、ある日までプロジェクトをgithubにアップロードしました。この問題がそれに関連しているかどうかは分かりませんが、今日はアンドロイドスタジオプロジェクトを編集したときに、この4つの恐ろしいエラーが表示されました。私はGoogleの結果の大部分を試しましたが、助けはありませんでした!Android Studio突然com.android.support ... 25.0.0のエラーメッセージを解決できず、すべてのJavaファイルが間違って表示されるようになりましたか?

Error:Failed to resolve: com.android.support:cardview-v7:25.0.0
Error:Failed to resolve: com.android.support:customtabs:25.0.0
Error:Failed to resolve: com.android.support:appcompat-v7:25.0.0
Error:Failed to resolve: com.android.support:support-v4:25.0.0

This is the screenshot of android studio screen if it helps!

これは私のアプリレベルbuild.gradleファイルです:

apply plugin: 'com.android.application' 

repositories { 
    mavenLocal() 
    mavenCentral() 
    flatDir { 
     dirs 'libs' 
    } 
} 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 
    defaultConfig { 
     applicationId "com.google.firebase.codelab.friendlychat" 
     minSdkVersion 22 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE-FIREBASE.txt' 
     exclude 'META-INF/NOTICE' 
    } 
    productFlavors { 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:design:23.1.1' 
    compile 'com.firebase:firebase-client-android:2.5.0' 

    compile 'com.github.bumptech.glide:glide:3.6.1' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    // Google 
    compile 'com.google.android.gms:play-services-auth:9.4.0' 
    // Firebase 
    compile 'com.google.firebase:firebase-database:9.4.0' 
    compile 'com.google.firebase:firebase-auth:9.4.0' 
    compile 'com.google.firebase:firebase-config:9.4.0' 
    compile 'com.google.android.gms:play-services-appinvite:9.4.0' 
    compile 'com.google.firebase:firebase-messaging:9.4.0' 
    compile 'com.google.android.gms:play-services-ads:9.4.0' 
    compile 'com.google.firebase:firebase-database:9.2.1' 
    compile 'com.google.firebase:firebase-messaging:9.2.1' 
    compile 'com.google.firebase:firebase-crash:9.4.0' 
    // Firebase UI 
    compile 'com.firebaseui:firebase-ui-database:0.4.0' 
    // Testing dependencies 
    androidTestCompile 'junit:junit:4.12' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' 
    androidTestCompile 'com.android.support.test:runner:0.4.1' 
    androidTestCompile 'com.android.support:support-annotations:23.4.0' 


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

apply plugin: 'com.google.gms.google-services' 

そして、これは私のプロジェクトレベルbuild.gradleファイルです:

buildscript { 
    repositories { 
     jcenter() 
     mavenLocal() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.2.2' 
     classpath 'com.google.gms:google-services:3.0.0' 


     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     mavenLocal() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

なぜこれらのエラーが突然発生し始めているのですか?
ありがとうございます!

+1

私も、奇妙に戻します! –

+0

これはなぜ青から外れているのですか?このGoogleのパッシブな攻撃的な方法は、私たちがapi 25に更新することですか? @ rahulのタイムリーな投稿でなければ、もっと多くの時間を無駄にしていたでしょう。 –

答えて

18

(Cから:\ Users \ユーザーyouruseraccount \のAppData \ローカル\アンドロイドの\ SDK)あなたのAndroid SDKマネージャーを開き

ツールセクションセクション

  1. 、最新のバージョンに以下とアップデートをAndroidのSDKツール

  2. のAndroid SDKプラットフォームツール

  3. アンドロイドSDKのビルド・ツール

のAndroid 7.1.1(API 25)セクション

  1. SDKプラットフォーム

エクストラセクション

  1. Androidのサポートリポジトリ
  2. Androidサポートライブラリ

それに応じてgradleファイルを更新します。

2

25.0.0バージョンのcardviewを使用している場合は、対象となるsdkバージョンの問題があると思います。それを25にして、それ以外の場合は、カードビューや他のライブラリを25.0.0から23.x.xにダウングレードしてください。

4

私は今日も同じ問題を抱えていました。どこかで、私はそれらの奇妙なエラーメッセージを持って始めました。更新:

    1. のAndroid SDKツール
    2. のAndroid SDKプラットフォーム・ツールは、Android SDKのビルド・ツール
    3. Androidのサポートリポジトリ

    は私のためにトリックをしました。 AndroidスタジオTools > Android > SDK Managerにアクセスして見つけて更新してください。がんばろう!

  • 3

    facebook-sdkコンパイルを依存関係から削除しようとすると、そのエラーは表示されません。だから私はFacebookのSDKのエラーだと思う。

    私は 'com.facebook.android:facebook-android-sdk:[4,5]'を使用していましたが、エラーが発生しました。私はこのcom.facebook.android:facebook-android-sdk:4.+を試しましたが、同じ。しかし、私はそれを正常にビルドするアプリケーションを削除します。私はこの結論に来て、同じ問題を抱えていますか?

    13

    最新のサポートライブラリを使用するようにSDKを更新しました。あなたはまだあなたのアンドロイドSDKを更新したくない場合は、

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

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

    を置き換えることができます。

    +0

    既にリリースされている「com.facebook.android:facebook-android-sdk:4+」を持っているこのねじ込みアプリはありますか? – AndroidDev21921

    +1

    @ AndroidDev21921 Nope –

    0

    Androidサポートリポジトリのバージョンを25に更新するだけで作業が完了しました。あなたの指導のおかげで!

    0

    あなたは、最新のFacebook SDKを追加したり、Facebookの依存関係のために+を使用している場合は、以前のバージョン

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

    関連する問題