LoginSignup
1
0

More than 3 years have passed since last update.

[Android Studio]本番環境をデバッグ可能にする

Last updated at Posted at 2020-08-18

忘備録。

問題

以下はエラー内容。
本番環境をデバッグできるようにしたい。

Error running 'app'
            Cannot debug application from module app on device emulator-5554.
            This application does not have the debuggable attribute enabled in its manifest.
            If you have manually set it in the manifest, then remove it and let the IDE automatically assign it.
            If you are using Gradle, make sure that your current variant is debuggable.

解決策

build.gradle に記載されている設定 debuggable をfalseからtrueへ変更

build.gradle

    buildTypes {
        release {
            debuggable true //変更

その後、メニューからBuild Bundle。
(Androidに不慣れすぎてこれに気づかなくて変更反映されなくて焦った)
スクリーンショット 2020-08-18 12.13.15.png

補足

Build Variantをdebugに変更する解決策もあるっぽいけど、これは今回やりたかったことではなかった。
スクリーンショット 2020-08-18 11.30.00.png

参考

アプリをビルドして実行する  |  Android デベロッパー  |  Android Developers
android - This application does not have the debuggable attribute enabled in its manifest - Stack Overflow

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0