質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

4028閲覧

突然、AndroidStudioのプロジェクトsync時にエラーがでるようになった

ykiyota

総合スコア21

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

1クリップ

投稿2019/12/18 10:53

編集2019/12/18 10:57

お世話になっております。
本日の昼ごろまで何事もなくコンパイルできていたプロジェクトが
突然プロジェクトをSyncするだけでエラーがでるようになりました。

Gitの変更内容を確認しても何も変更ありませんでした。
突然のことでどのように解決をすればよいのかわかりません。

とりあえずは、オフラインモードで実行すれば現在のアプリの実行はできるようなので
一旦、それで急場をしのいでおります。
なにか解決方法がわかる方いましたら、ご教示いただけませんでしょうか?

以下、開発環境、及び、エラー内容と、各種Build.gradle内容です。

■開発環境

Mac OS 10.14.6(Mojave) Android Studio 3.5.3

■Projectのbuild.gradle

buildscript { repositories { google() jcenter() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'com.android.tools.build:gradle:3.5.2' classpath 'com.deploygate:gradle:2.0.1' classpath 'com.google.gms:google-services:4.3.3' classpath 'io.fabric.tools:gradle:1.28.1' classpath 'com.google.firebase:perf-plugin:1.3.1' } } allprojects { repositories { google() jcenter() maven { url 'https://github.com/yanzm/LoopViewPager/raw/master/maven-repo' } maven { url 'https://maven.google.com/' } maven { url 'http://plaidev.github.io/karte-tracker-android/maven-repo' } maven { url 'https://jitpack.io' } } }

■Moduleのbuild.gradle

apply plugin: 'com.android.application' apply plugin: 'com.google.firebase.firebase-perf' apply plugin: 'deploygate' apply plugin: 'io.fabric' android { compileSdkVersion 28 buildToolsVersion '29.0.2' useLibrary 'org.apache.http.legacy' lintOptions { checkReleaseBuilds false abortOnError false } defaultConfig { minSdkVersion 19 targetSdkVersion 28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true vectorDrawables.useSupportLibrary = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } (中略) dependencies { (中略) implementation 'com.google.firebase:firebase-core:17.2.1' implementation 'com.google.firebase:firebase-firestore:21.3.1' implementation 'com.google.firebase:firebase-messaging:20.1.0' implementation 'com.google.firebase:firebase-appindexing:19.0.0' implementation 'com.google.firebase:firebase-perf:19.0.3' implementation 'com.google.firebase:firebase-config:19.0.4' implementation 'com.google.android.gms:play-services-tagmanager:17.0.0' apply plugin: 'com.google.gms.google-services' }

■エラー内容

root project:root project 'app'Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.google.firebase, artifactId=firebase-messaging, version=20.1.0), toArtifact=Artifact(groupId=com.google.firebase, artifactId=firebase-iid), toArtifactVersionString=[20.0.2]) FAILURE: Build failed with an exception. * What went wrong: In project 'sample' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[20.0. 2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown. Dependency failing: com.google.firebase:firebase-messaging:20.1.0 -> com.google.firebase:firebase-iid@[20.0.2], but fire base-iid version was 20.0.1. The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'sample' depends onto com.google.firebase:firebase-core@17.2.1 -- Project 'sample' depends onto com.google.firebase:firebase-config@{strictly 19.0.4} -- Project 'sample' depends onto com.google.firebase:firebase-perf@19.0.3 -- Project 'sample' depends onto com.google.firebase:firebase-messaging@{strictly 20.1.0} -- Project 'sample' depends onto com.google.firebase:firebase-core@{strictly 17.2.1} -- Project 'sample' depends onto com.google.android.gms:play-services-measurement-api@{strictly 17.2.1} -- Project 'sample' depends onto com.google.firebase:firebase-analytics@{strictly 17.2.1} -- Project 'sample' depends onto com.google.firebase:firebase-messaging@20.1.0 -- Project 'sample' depends onto com.google.firebase:firebase-iid@{strictly 20.0.1} -- Project 'sample' depends onto com.google.firebase:firebase-config@19.0.4 -- Project 'sample' depends onto com.google.firebase:firebase-perf@{strictly 19.0.3} For extended debugging info execute Gradle from the command line with ./gradlew --info :bod:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

このエラーを受けて、com.google.firebase:firebase-iid@[20.0.2]のライブラリを追加すればよいのかと思い、

implementation 'com.google.firebase:firebase-iid:20.0.2'

をModuleのbuild.gradleに追加して再度sync実行してみたのですが、
今度は、

FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':bod:liveDebugRuntimeClasspath'. > Could not determine artifacts for com.google.firebase:firebase-iid:20.0.2 > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid/20.0.2/firebase-iid-20.0.2.aar'. > Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid/20.0.2/firebase-iid-20.0.2.aar'. > Remote host closed connection during handshake * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s ERROR: SSL peer shut down incorrectly

のエラーがでるようになりました。
ブラウザで
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid/20.0.2/firebase-iid-20.0.2.aar
をアクセスすると、aarをダウンロードしに行くのでurl自体は存在するようですが、公開されてはいないということでしょうか?

同じような現象が起きた方、解決方法を知っている方がいましたらどうかご教示いただけませんでしょうか?
よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

なぜか、本日、再度オフラインモードを解除して実行してみたら、
何事もなかったかのようにSyncも正常にできるようになりました。

一時的なものだったのでしょうか?
PCも落として、一日経過したのが良かったのでしょうか?
熱暴走とか??? Mac Book Proの2019モデルなのですが…

原因がわからないのでもやもや感が残りますが、
とりあえずは解決したのでクローズします。

投稿2019/12/19 01:19

ykiyota

総合スコア21

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問