Getting debuggable value of androidManifest from code?
Use PackageManager
to get an ApplicationInfo
object on your application, and check the flags
field for FLAG_DEBUGGABLE
.
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
Android 'debuggable' default value
From SDK Tools : ( SDK Tools, Revision 8 (December 2010) )
Support for a true debug build.
Developers no longer need to add the
android:debuggable
attribute to the
<application>
tag in the manifest —
the build tools add the attribute automatically. In Eclipse/ADT, all
incremental builds are assumed to be
debug builds, so the tools insert
android:debuggable="true"
. When
exporting a signed release build,
the tools do not add the attribute.
In Ant, aant debug
command
automatically inserts the
android:debuggable="true" attribute,
whileant release
does not. If android:debuggable="true" is manually
set, thenant release
will actually do
a debug build, rather than a release
build.
How to check Android manifest parameters with code
Here is how to check if the debuggable attribute is set in the manifest:
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
Shamelessly stolen from here:
https://stackoverflow.com/a/4277868/483708
This application does not have the debuggable attribute enabled in its manifest
Your comment has already hinted the answer to this post but since you have not selected an answer I'll write it down.
Change build variant from release to debug from android studio left corner.
My debug AndroidManifest.xml is giving me cannot resolve symbol errors
Go to File > Invalidate Caches / Restart and Invalidate and Restart.
This cleared the errors for me.
Avoid hardcoding the debug mode; Warning in Android Manifest
Yup, just noticed this too. I removed the debuggable attribute from the manifest, and I can now both run the app in debug mode and export it to a market-ready APK file without changing any code.
Slick!
Full explanation here
https://stackoverflow.com/a/4580630/682754
Related Topics
Get File Path of Image on Android
Mediarecorder Start Failed: -38
Android Devices with Different Height Takes Same Layout Folder
Android Volley Self Signed Https Trust Anchor for Certification Path Not Found
What's the Maximum Size for an Android Shared Preference Value
Google Maps API V2 'Failed to Load Map. Could Not Contact Google Servers'
Jpeg Images Have Different Pixel Values Across Multiple Devices
Mapview Rendering with Tiles Missing with an "X" in the Center
How to Keep a Countdowntimer Running Even If the App Is Closed
Replacing Glreadpixels with Egl_Khr_Image_Base for Faster Pixel Copy
Android: Automatically Choose Debug/Release Maps V2 API Key
Android Support Library Setup with Maven
Erase Bitmap Parts Using Porterduff Mode
Surfacetexture's Onframeavailable() Method Always Called Too Late
How to Set Text to View from Drawer Header Layout in Navigation Drawer Without Inflating View