開発環境
・AndroidStudioにてkotlin言語でGoogleFitの機能を用いた実装中
・マニュアルに従ってアプリ起動時にクライアントIDにてスコープ認証を行う機能を実装してみた
問題
・スコープ認証が条件によってはうまく動かない
※各条件ごとのGoogleCloudPlatformと実機挙動のスクショを添付しております
A)本番環境での実機テスト
「未確認のアプリ」の画面が表示されるタイミングで固まってしまいました
B-1)テスト環境での実機テスト ※テストユーザーで認証
上手く認証できた
※ここで認証できていることから、スコープの設定と認証情報の作成はうまくいっていると思っています
B-2)テスト環境での実機テスト ※非テストユーザーで認証
「未確認のアプリ」の画面が表示されるタイミングで固まってしまいました
ソース
▼AmdroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="unity.yoububun.fitoathtest">
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.FitOathTest">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
▼App内のbuild.gradle ※一部省略
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {//デフォルトのままなので省略}
dependencies {
implementation ("com.google.android.gms:play-services-fitness:20.0.0")
implementation ("com.google.android.gms:play-services-auth:19.2.0")
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
▼MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val fitnessOptions = FitnessOptions.builder()
.addDataType(DataType.TYPE_STEP_COUNT_DELTA, FitnessOptions.ACCESS_READ)
.addDataType(DataType.AGGREGATE_STEP_COUNT_DELTA, FitnessOptions.ACCESS_READ)
.build()
val account = GoogleSignIn.getAccountForExtension(this, fitnessOptions)
if (!GoogleSignIn.hasPermissions(account, fitnessOptions)) {
GoogleSignIn.requestPermissions(
this, // your activity
10, // e.g. 1
account,
fitnessOptions)
}
else {
}
}
}
質問内容
「未確認のアプリ」の画面が表示されない原因について
何か情報をいただけますと幸いです。
長々と申し訳ございません。ご確認お願い致します。
エラー内容(LogCat)
A)本番環境での実機テストで行った際のLogcatでのエラーログを追記いたします
2021-09-04 18:35:52.531 1133-1133/? E/LOGD: logd_dispatch_uevent() failed
2021-09-04 18:35:52.538 12834-12862/? E/DetectMoisture: [onUEventForWireless] IOException
2021-09-04 18:35:52.542 12834-12862/? E/DetectMoisture: [onUEventForPadDetect] IOException
2021-09-04 18:35:52.899 32526-32526/? E/EmojiDrawable: stopCallbackDrawing parameter is failhandler = null
2021-09-04 18:35:53.188 14549-14549/? E/.android.chrom: Not starting debugger since process cannot load the jdwp agent.
2021-09-04 18:35:53.209 16445-16818/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT. App: unity.yoububun.fitoathtest, Service: oauth2:https://www.googleapis.com/auth/fitness.activity.read
2021-09-04 18:35:53.737 1101-10629/? E/ANDR-IOP: IIop:: Iop HAL Service is not available.
2021-09-04 18:35:53.746 14596-14596/? E/webview_servic: Not starting debugger since process cannot load the jdwp agent.
2021-09-04 18:35:53.798 27735-29915/? E/WindowManager: App trying to use insecure INPUT_FEATURE_NO_INPUT_CHANNEL flag. Ignoring
2021-09-04 18:35:53.828 14617-14617/? E/m.android.emai: Not starting debugger since process cannot load the jdwp agent.
2021-09-04 18:35:53.873 32526-32526/? E/EmojiDrawable: stopCallbackDrawing parameter is failhandler = null
2021-09-04 18:35:53.912 1101-10629/? E/ANDR-IOP: IIop:: Iop HAL Service is not available.
2021-09-04 18:35:54.014 16445-16818/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> NEED_REMOTE_CONSENT. App: unity.yoububun.fitoathtest, Service: oauth2:https://www.googleapis.com/auth/fitness.activity.read
2021-09-04 18:35:54.126 14663-14663/? E/ndroid.exchang: Not starting debugger since process cannot load the jdwp agent.