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

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

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

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

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

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

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

Q&A

解決済

1回答

402閲覧

Androidアプリを起動できません。

jmdajmw

総合スコア352

XML

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

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Android Studio

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

Kotlin

Kotlinは、ジェットブレインズ社のアンドリー・ブレスラフ、ドミトリー・ジェメロフが開発した、 静的型付けのオブジェクト指向プログラミング言語です。

0グッド

0クリップ

投稿2023/08/12 04:32

実現したいこと

普通にAndroidアプリを起動したい

前提

Androidアプリを実装中に以下のエラーメッセージが発生しました。

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

--------- beginning of crash 2023-08-12 00:30:37.037 6696-6696 AndroidRuntime pid-6696 E FATAL EXCEPTION: main Process: com.aaa.bbb, PID: 6696 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaa.bbb/com.aaa.bbb.MainActivity}: android.view.InflateException: Binary XML file line #8 in com.aaa.bbb:layout/activity_main: Binary XML file line #8 in com.aaa.bbb:layout/activity_main: Error inflating class androidx.constraintlayout.widget.ConstraintLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3644) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3781) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7918) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

該当のソースコード

xml

1<?xml version="1.0" encoding="utf-8"?> 2<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent" 6 android:layout_height="match_parent" 7 android:background="@drawable/background" 8 tools:context=".MainActivity"> 9 10 <LinearLayout 11 android:layout_width="match_parent" 12 android:layout_height="wrap_content" 13 android:layout_margin="2dp" 14 android:orientation="vertical" 15 tools:ignore="MissingConstraints"> 16 17 <LinearLayout 18 android:layout_width="wrap_content" 19 android:layout_height="wrap_content" 20 android:layout_margin="8dp" 21 android:orientation="vertical"> 22 <TextView 23 android:id="@+id/dayText" 24 android:layout_width="wrap_content" 25 android:layout_height="wrap_content" 26 android:gravity="left" 27 android:textColor="@color/black" 28 android:textIsSelectable="true" 29 android:text="生年月日" /> 30 <LinearLayout 31 android:layout_width="wrap_content" 32 android:layout_height="wrap_content" 33 android:layout_margin="8dp" 34 android:orientation="horizontal"> 35 <Spinner 36 android:id="@+id/year_spinner" 37 android:layout_width="wrap_content" 38 android:layout_height="wrap_content" 39 android:entries="@array/year_list" 40 android:layout_margin="2dp" 41 android:spinnerMode="dialog"/> 42 <TextView 43 android:id="@+id/year" 44 android:layout_width="wrap_content" 45 android:layout_height="wrap_content" 46 android:gravity="left" 47 android:textColor="@color/black" 48 android:textIsSelectable="true" 49 android:text="" /> 50 </LinearLayout> 51 <LinearLayout 52 android:layout_width="wrap_content" 53 android:layout_height="wrap_content" 54 android:layout_margin="8dp" 55 android:orientation="horizontal"> 56 <Spinner 57 android:id="@+id/month_spinner" 58 android:layout_width="wrap_content" 59 android:layout_height="wrap_content" 60 android:entries="@array/month_list" 61 android:layout_margin="2dp" 62 android:spinnerMode="dialog"/> 63 <TextView 64 android:id="@+id/month" 65 android:layout_width="wrap_content" 66 android:layout_height="wrap_content" 67 android:gravity="left" 68 android:textColor="@color/black" 69 android:textIsSelectable="true" 70 android:text="" /> 71 <Spinner 72 android:id="@+id/day_spinner" 73 android:layout_width="wrap_content" 74 android:layout_height="wrap_content" 75 android:entries="@array/day_list" 76 android:layout_margin="2dp" 77 android:spinnerMode="dialog"/> 78 <TextView 79 android:id="@+id/day" 80 android:layout_width="wrap_content" 81 android:layout_height="wrap_content" 82 android:gravity="left" 83 android:textColor="@color/black" 84 android:textIsSelectable="true" 85 android:text="" /> 86 </LinearLayout> 87 <Button 88 android:id="@+id/aaa_button" 89 android:layout_width="wrap_content" 90 android:layout_height="wrap_content" 91 android:onClick="aaa" 92 android:text="aaa" 93 /> 94 <TextView 95 android:id="@+id/aaa_resultText" 96 android:layout_width="wrap_content" 97 android:layout_height="wrap_content" 98 android:gravity="left" 99 android:textColor="@color/black" 100 android:textIsSelectable="true" 101 android:text="結果" /> 102 </LinearLayout> 103 104 </LinearLayout> 105 106</androidx.constraintlayout.widget.ConstraintLayout>

試したこと

自分のスマホでは動く、お客さんのスマホではエラーになる。

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

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

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

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

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

hoshi-takanori

2023/08/12 11:22

ご自分のスマホと、お客さんのスマホの Android OS のバージョンは分かりますか? また、app モジュールの build.gradle の中身は?
jmdajmw

2023/08/12 11:43

お客さん自身がAndroidStudioを使ってBuildしているからよくわからなくて。 私の環境でBuildしたapkをお客さんのスマホで動かして貰えば何かわかるかも。
jimbe

2023/08/12 12:01

レイアウト xml の 8 行目がダメだと言われているのですから、その辺りを中心に何が違うのか探すしかないでしょうね。
jmdajmw

2023/08/12 12:03

それが同じxmlを使って、私の環境では正常に動いてお客さんがBuildしたapkだと起動出来ないみたいなんですよ。
hoshi-takanori

2023/08/12 13:10

> お客さん自身がAndroidStudioを使ってBuildしているからよくわからなくて。 なるほど…。とりあえず私の環境では動きましたので、お客さんの環境の問題だと思いますけど、情報が少なすぎてよく分からないですね。とりあえずお客さんの Android Studio のバージョンを確認すべきかと。
hoshi-takanori

2023/08/12 21:55

というか、もしかして layout xml (とか java や kt ファイル) だけをお客さんに渡してるのでしょうか?
jmdajmw

2023/08/12 22:10

そうですよ。
hoshi-takanori

2023/08/12 22:25

それは一般的なやり方ではないような。普通はプロジェクトフォルダ一式を (できれは git などのバージョン管理ツールを使って) 丸ごと渡すのでは…。
jmdajmw

2023/08/12 22:27

それはお客さんわからないと思う。
jimbe

2023/08/13 02:28

プロジェクトの事情は各々でしょうけれど、再現せず、他に情報が無いのであれば、後は分かる人が現場で直接調べるしかないでしょう。
guest

回答1

0

自己解決

✕EmptyActivity
◎EmptyViewActivity

投稿2023/08/26 01:50

jmdajmw

総合スコア352

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.31%

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

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

質問する

関連した質問