エミュレータではインストールされるのに実機だとインストールされない
解決済
回答 1
投稿
- 評価
- クリップ 0
- VIEW 632
Android Studioでコードを書いてAndroidアプリを作っております。
実機でデバッグしていたのですが、Run'app'(緑色の三角)を押したあとアプリがインストールされなくなりました。
エミュレータでは問題なくインストール・起動がされています。
解決策をお教えいただきたいです。
発生している問題・エラーメッセージ
-------------Event Log-------------
18:20 Executing tasks: [:app:assembleDebug]
18:20 Gradle build finished in 3 s 172 ms
18:20 Install successful
18:20 Session 'app': Error Launching activity
-------------Run app-------------
06/08 18:20:17: Launching app
$ adb shell am start -n "com.×××××××××××.×××××××××××/com.×××××××××××.×××××××××××.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.×××××××××××.×××××××××××/com.×××××××××××.×××××××××××.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.×××××××××××.×××××××××××/.MainActivity }
Error type 3
Error: Activity class {com.×××××××××××.×××××××××××/com.×××××××××××.×××××××××××.MainActivity} does not exist.
Error while Launching activity
-------------Logcat-------------
2019-06-08 18:23:49.276 7806-7843/com.×××××××××××.××××××××××× E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED
該当のソースコード
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.×××××××××××.×××××××××××">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".×××××××××××Activity"
android:screenOrientation="portrait" />
<activity
android:name=".×××××××××××Activity"
android:screenOrientation="portrait" />
<activity android:name=".×××××××××××Activity" />
<activity android:name=".×××××××××××Activity" />
<meta-data
android:name="google_analytics_adid_collection_enabled"
android:value="false" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/app_id"/>
</application>
</manifest>
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.×××××××××××.×××××××××××"
minSdkVersion 21
targetSdkVersion 28
versionCode 11
versionName "4.0.0.11"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.google.android.gms:play-services-ads:17.2.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-ads:17.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
補足情報
AndroidStudio 3.4.1
使用エミュレータ Pixel 2 XL API 28
使用実機 Xperia XZ3 API 28
×××××××××××の部分は伏せ字にさせていただいております。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.33%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
keicha_hrs
2019/06/08 23:33
> 実機でデバッグしていたのですが
実機でデバッグできていたものが、あるときからできなくなったという質問ですか?それとも、初めて実機でデバッグしようとしたら、実機上で動作させることができなかったという質問ですか?
CoC1216
2019/06/09 15:27
コメントありがとうございます。
前者です。
実機のゲストユーザ含めすべてのユーザから該当アプリを一度アンインストールしたところ無事解決しました。
互換性のない同パッケージアプリが別のユーザにインストールされていたことが原因のようです。