facebook

Codova 3.5-Build Android fail after enabling debugging

  1. GapDebug
  2.  > 
  3. Getting Help – GapDebug
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #350929 Reply

    karen3235
    Member

    0) version of GapDebug installed, e.g., 2014EA1, 2014, 2014SR1…
    2014EA3

    1) Mobile device and OS version, e.g., iPhone5s/iOS 7.1.1, Nexus5/Android 4.4.3…
    Android 4.4.2

    2) Workstation OS version (Win7, Mac OSX Yosemite, …) if a GapDebug software problem
    Mac OSX

    3) Description of the problem and if you can reproduce it consistently. Include a step by step description for how we can reproduce it is always appreciated
    1. Add the following snappet to my config.xml. I am using cordova 3.5
    <gap:config-file platform=”android” parent=”/manifest”>
    <application android:debuggable=”true” />
    </gap:config-file>
    2. Run cordova build android. It failed with the following error message:

    -code-gen:
    [mergemanifest] Found Deleted Target File
    [mergemanifest] Merging AndroidManifest files into one.
    [mergemanifest] Manifest merger disabled. Using project manifest only.
    [echo] Handling aidl files…
    [aidl] No AIDL files to compile.
    [echo] ———-
    [echo] Handling RenderScript files…
    [echo] ———-
    [echo] Handling Resources…
    [aapt] Found modified input file
    [aapt] Generating resource IDs…
    [aapt] /Users/tenx/learning/hello/platforms/android/res/xml/config.xml:22: error: Error parsing XML: unbound prefix

    BUILD FAILED
    /Users/tenx/java/adt/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
    /Users/tenx/java/adt/adt-bundle-mac-x86_64-20131030/sdk/tools/ant/build.xml:698: null returned: 1

    Total time: 2 seconds
    Error code 1 for command: ant with args: debug,-f,/Users/tenx/learning/hello/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
    Error: /Users/tenx/learning/hello/platforms/android/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

    4) screenshot(s) if the problem can be observed through the UI or your app

    5) GapDebug log file, located at <user-home>/.gapdebug/runtime/.metadata/.log if GapDebug software problem

    6) Any other info that you feel will be helpful in resolving your problem quickly

    #350938 Reply

    support-michael
    Keymaster

    @karen3235

    Investigating. Will follow up asap

    #350941 Reply

    support-michael
    Keymaster

    I believe the issue is caused by the android namespace being undefined in the config.xml. See line #3 below and this doc for more info. Let us know how this turns out.

    1 <widget xmlns="http://www.w3.org/ns/widgets" 
    2    xmlns:gap="http://phonegap.com/ns/1.0"
    3    xmlns:android   = "http://schemas.android.com/apk/res/android" 
    4    ...
    

    If you still have an issue then rollback your config.xml by removing your changes. Then in your AndroidManifest.xml add the android:debuggable attribute as shown below.

     <application android:debuggable="true" ...
    #350945 Reply

    karen3235
    Member

    Thanks for your reply. Adding ” xmlns:android = “http://schemas.android.com/apk/res/android&#8221; to config.xml will not fix the problem. The following snappet can not be recognized.
    <gap:config-file platform=”android” parent=”/manifest”>
    <application android:debuggable=”true” />
    </gap:config-file>

    I tried to android:debuggable=”true” to my AndroidManifest.xml to make the app debuggable. The GapDebug could detect the app but just can not load the inspector

    #350946 Reply

    karen3235
    Member

    Sorry I could not upload the screenshot.

    It just waiting from localhost… A white screen.

    #350954 Reply

    support-michael
    Keymaster

    @karen3235

    Apologies on the slow follow up; I needed to setup a cordova 3.5 env to investigate. Try rolling back to the original config.xml and androidmanifest.xml. I don’t think the debug setting is required with the latest cordova android platform.

    Once I completed the cordova 3.5 update I built the helloworld example (I named mine project chello because I already had a similar project named hello). I did not include any special debug settings. I simply built the project straight away. Notice in the screenshot below a debug version of my app was created by default. I drag-dropped this CHelloWorld-debug.apk onto my nexus 5 device in the gapdebug UI to install it. Then I launched it on my nexus 5 and began debugging it. See attachment android-debug.png

    The gapdebug android documentation was written earlier in the summer. It was required at that time to enable debugging. I don’t believe it is required now but need to do some additional investigation. I’ll update the docs to asap.

    Let us know if removing all debug config settings works for you.

    Attachments:
    You must be logged in to view attached files.
    #350969 Reply

    karen3235
    Member

    It does not work either.

    #350975 Reply

    support-michael
    Keymaster

    >It does not work either.

    Since I can’t see your screen please clarify what “does not work either” mean. Do you get the same compilation error reported earlier or something else? If something else please describe in detail or attach a screenshot (keep screenshots as small as possible).

    If you still experience a compilation error when building your project then do exactly what I did last Friday – that is start with the simplest possible project you can create and get it compiling. Create a new hello world project configured with the android platform. I installed cordova and phonegap 3.5 versions and android 19 api and dev tools on a new windows7 workstation for this support case. Build the project without making any modifications to the project, e.g., do not set any debug settings, do not mess with any plugins, etc. – go for simplest setup. The screenshot above are the apks generated by my super simple project.

    Are you able to build the app for android? If yes, then look at the apk file(s) that were created.

    #351606 Reply

    johnwargo
    Member

    I’m having the same problem. When I add the:

    <gap:config-file platform=”android” parent=”/manifest”>
    <application android:debuggable=”true” />
    </gap:config-file>

    to the Cordova project’s config.xml, the project won’t compile:

    /Users/jwargo/dev/firstapp/platforms/android/cordova/node_modules/q/q.js:126
    throw e;
    ^
    Error code 1 for command: ant with args: debug,-f,/Users/jwargo/dev/firstapp/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
    Error: /Users/jwargo/dev/firstapp/platforms/android/cordova/run: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)
    jwargo@mini:~/dev/firstapp$

    When I remove it, it will build and run on the device, but GapDebug won’t see it.

    Do we have any new suggestions? This is on OS X and I’m running Cordova 3.5.0-0.2.7

    #351701 Reply

    support-michael
    Keymaster

    @johnwargo
    I reviewed the GapDebug configuration doc and determined the following snippet is only valid for when using the PhoneGap Build cloud service. The doc needs to be updated and better clarification. I’m working on that now. The following snippet

     FOR USE WITH PHONEGAP BUILD ONLY - Add the following snippet to the project config.xml
    
    <gap:config-file platform="android" parent="/manifest">
         <application android:debuggable="true" />
    </gap:config-file>

    Here are the details for configuring debug mode for local cordova and phonegap android builds.
    In <project>/platforms/android/AndroidManifest.xml add the android:debuggable attribute to the <application> element. See the snippet below. Don’t forget to set the android:debuggable attribute to false or remove it completely for a production release.

     USE ONLY WITH CORDOVA OR PHONEGAP LOCAL BUILDS. Modify the the application element in AndroidManifest.xml
    <manifest>
       ....
       <application [b]android:debuggable="true"[/b] .... >
       ...
    </manifest>
    
Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Codova 3.5-Build Android fail after enabling debugging

You must be logged in to post in the forum log in