◼︎開発環境
・macOS Monterey(M1)
・Android Studio 4.2.2
・Flutter 3.3.4
・Simulator iPhone 14 Pro Max iOS 16.0
・Android Emulator Pixel_3_API_S:5554 Target:Android API 31(Google Play) arm64 11GB
・VS Code 1.72.2 (Universal)
上記環境で、twitterのような簡単なSNSを作っています。
ソースコードにエラーや警告はなく、アプリも落ちずに正常通り画面遷移できるのですが、ビルド後、下記のエラーが発生し、解決できずにいます。
直前にやったことは、Firebaseとの連携を行い、アカウント作成できるように実装していました。
エラーを見ますと、「GoogleLocationManagerService を作成できません」や「「S+ (バージョン 10000 以降)」 をターゲットにするには、PendingIntent の作成時に FLAG_IMMUTABLE または FLAG_MUTABLE のいずれかを指定する必要があります」との記載がありましたが、何が原因かわからないです。
Running "flutter pub get" in twitter... Launching lib/main.dart on sdk gphone64 arm64 in debug mode... Running Gradle task 'assembleDebug'... ✓ Built build/app/outputs/flutter-apk/app-debug.apk. Debug service listening on ws://127.0.0.1:49560/f6yvp74bsvU=/ws Syncing files to device sdk gphone64 arm64... E/AndroidRuntime(17711): FATAL EXCEPTION: main E/AndroidRuntime(17711): Process: com.google.android.gms.persistent, PID: 17711 E/AndroidRuntime(17711): java.lang.RuntimeException: Unable to create service com.google.android.location.internal.GoogleLocationManagerService: java.lang.IllegalArgumentException: com.google.android.gms: Targeting S+ (version 10000 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. E/AndroidRuntime(17711): Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. E/AndroidRuntime(17711): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4387) E/AndroidRuntime(17711): at android.app.ActivityThread.access$1600(ActivityThread.java:250) E/AndroidRuntime(17711): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2004) E/AndroidRuntime(17711): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(17711): at android.os.Looper.loopOnce(Looper.java:201) E/AndroidRuntime(17711): at android.os.Looper.loop(Looper.java:288) E/AndroidRuntime(17711): at android.app.ActivityThread.main(ActivityThread.java:7858) E/AndroidRuntime(17711): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(17711): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/AndroidRuntime(17711): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:984) ・ ・ ・
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。