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

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

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

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

Android Wear

Android Wearとは、Googleが発表した腕時計型ウェアラブルデバイス(スマートウォッチ)向けのプラットフォームです。GoogleのAndroid OSをベースにしており、情報の入手・管理などを行うことができます。

Android Studio

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

Q&A

0回答

1959閲覧

android studioでのAndroid resource linking failed

harao_

総合スコア0

XML

XMLは仕様の1つで、マークアップ言語群を構築するために使われています。

Android Wear

Android Wearとは、Googleが発表した腕時計型ウェアラブルデバイス(スマートウォッチ)向けのプラットフォームです。GoogleのAndroid OSをベースにしており、情報の入手・管理などを行うことができます。

Android Studio

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

0グッド

0クリップ

投稿2021/06/09 07:06

編集2021/06/19 15:48

前提・実現したいこと

(android studio初心者でとんちんかんな質問をしていたら申し訳ございません。)

android studioでウェアラブル端末での脈波計測をしたく、
https://mio.yokohama/?p=479
のプログラムを参考にして制作しようとしました。
とりあえずここのプログラムをそのまま実行しようとしたところ以下のエラーメッセージが発生しました。

発生している問題・エラーメッセージ

Android resource linking failed ERROR:C:\Users\harao\AndroidStudioProjects\BVP3\app\src\main\res\layout\activity_main.xml:31: AAPT: error: attribute layout_box (aka com.example.bvp3:layout_box) not found.

該当のソースコード

xml

1<?xml version="1.0" encoding="utf-8"?> 2<android.support.wearable.view.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 xmlns:tools="http://schemas.android.com/tools" 5 android:id="@+id/container" 6 android:layout_width="match_parent" 7 android:layout_height="match_parent" 8 tools:context="yokohama.mio.heartbeat.MainActivity" 9 tools:deviceIds="wear"> 10 <View 11 android:layout_width="wrap_content" 12 android:layout_height="wrap_content" 13 android:layout_alignParentEnd="true" 14 android:id="@+id/View" 15 android:layout_alignParentBottom="true" 16 android:layout_gravity="center_vertical|center_horizontal"/> 17 <ImageView 18 android:id="@+id/imageView" 19 android:layout_width="match_parent" 20 android:layout_height="wrap_content" 21 android:src="@drawable/heart" 22 android:scaleType="center" 23 android:contentDescription="heart" 24 android:layout_gravity="center_vertical|center_horizontal" /> 25 <TextView 26 android:id="@+id/text_heart" 27 android:layout_width="match_parent" 28 android:layout_height="match_parent" 29 app:layout_box="all" 30 android:text="" 31 android:gravity="center_vertical|center_horizontal" /> 32 <TextView 33 android:id="@+id/text" 34 android:layout_width="match_parent" 35 android:layout_height="match_parent" 36 app:layout_box="all" 37 android:text="心拍数測定中\nちょっと待ってね" 38 android:textSize="40sp" 39 android:gravity="center_vertical|center_horizontal" 40 android:textColor="#0000FF" /> 41</android.support.wearable.view.BoxInsetLayout> 42 43ここのandroid:gravity="center_vertical|center_horizontal" />がエラーを出した箇所です。 44android.support.wearable.view.BoxInsetLayoutが赤字になってます。 45

試したこと

とりあえずapp:layout_box="allを削除するとエラーが消えますが、根本的な解決になってなさそうです。

補足情報(FW/ツールのバージョンなど)

compile sdk versionは30を使用していて、それに合わせてbuild tool version30.0.2、target SDK version30を使用しています。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問