android:debuggable="@bool/debuggable" in AndroidManifest.xml not recognized by Eclipse

1,284 views
Skip to first unread message

Dirk Jäckel

unread,
Aug 16, 2012, 5:53:46 AM8/16/12
to adt...@googlegroups.com
Hi!

I have the following in my res/values/config.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="debuggable" type="bool">true</item>
</resources>


And the following in the AndroidManifest.xml:

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:debuggable="@bool/debuggable">

When I try to debug the application with Eclipse I get the following
error message:

[2012-08-16 11:23:01 - Foo-Android] Application 'de.foo.bar' has its
'debuggable' attribute set to FALSE and cannot be debugged.

Shouldn't Eclipse recognize the resource reference?

If I change android:debuggable="@bool/debuggable" to
android:debuggable="true" Eclipse can debug the application.

The reference does work with Maven and IntelliJ IDEA. In other words:
a debuggable Application is created if I use those.

Regards,
Dirk

Xavier Ducrohet

unread,
Aug 16, 2012, 2:34:14 PM8/16/12
to adt...@googlegroups.com
Yes we should definitively resolve it properly.

May I ask, though, why you are using this? Early on in the SDK you had
to set this manually, but it's been several years now that the build
system automatically inserts true when doing a debug build, so that
you don't have to (and more importantly so that you can do debug and
release builds without editing any files)
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Dirk Jäckel

unread,
Aug 16, 2012, 4:38:01 PM8/16/12
to adt...@googlegroups.com
Well. As I implied. :-) I am using IntelliJ and Maven to build the
project. My colleagues use Eclipse.

I thought I needed this to build debuggable APKs. It seems IntelliJ
IDEA always sets this to true when I use a run or debug configuration.
Interestingly enough, even when I set it to false. So I guess I do not
know whether IDEA is resolving this reference.

Now I need to check if the android-maven-plugin support aapts
--debug-mode switch to set it for certain builds. It seems, it does
via

<aaptExtraArgs><aaptExtraArg>--debug-mode</aaptExtraArg></aaptExtraArgs>

See: http://stackoverflow.com/a/9499287/199972

Regards,
Dirk

Xavier Ducrohet

unread,
Aug 16, 2012, 4:42:08 PM8/16/12
to adt...@googlegroups.com
Does that Maven configuration applies to all builds though? or can you
create build variant and only have it in one type of builds?

I would think IntelliJ at least does this?

Having to edit any files to change the build from debug to release is
just not something that makes sense, hence why the official tools let
you build debug or release version with no edits.

Dirk Jäckel

unread,
Aug 16, 2012, 5:52:04 PM8/16/12
to adt...@googlegroups.com
I use maven profiles to configure several build properties. One of
them is debuggable. Profiles can be selected on the command line. No
need to edit any file.

Regards,
Dirk

Xavier Ducrohet

unread,
Aug 16, 2012, 5:57:48 PM8/16/12
to adt...@googlegroups.com
Perfect then! This is really the way to go.

We actually have a lint check that will warn if you put something in
the debuggeable attribute in the manifest.
Reply all
Reply to author
Forward
0 new messages