Help us understand the problem. What is going on with this article?

【Android】ビルド時エラー

More than 1 year has passed since last update.

昔々に入れたAndroid Studioを久々に触ったらエラーが出たので対処法をメモ。

前提

エラー文言

  Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

対処

  • エラー文言の参照ページを見た
    参照ページ

  • そもそも何を言っているかよくわからない段階なので日本語の記事を探した
    同じ事象を発見

  • テストアプリと本番アプリのSDKバージョンが違う(?)らしい

  • app > build.gradle 内のSDKバージョン記載を27.1.1に上げた。(テストSDKのバージョン下げ方がわからない)

メモ

SDKバージョンよる差があまりわからないままバージョンを上げてしまったので、これが正解なのかよくわからない・・・
見たところ、SDKバージョン26も27もOreo向けなので大丈夫なのではないかと期待しつつ・・・
未だ「テストアプリ」とは?段階なので、後々正しい修正方法が分かり次第情報更新します。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした