Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 60FADCF50 for ; Thu, 25 Jul 2013 17:33:53 +0000 (UTC) Received: (qmail 61889 invoked by uid 500); 25 Jul 2013 17:33:52 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 61828 invoked by uid 500); 25 Jul 2013 17:33:52 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 61796 invoked by uid 99); 25 Jul 2013 17:33:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 17:33:52 +0000 Date: Thu, 25 Jul 2013 17:33:51 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-4198) cordova platform add android fails due to unexpected error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-4198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13719811#comment-13719811 ] ASF subversion and git services commented on CB-4198: ----------------------------------------------------- Commit b4236b978355a599cad77a4d2a776354dbfdbe09 in branch refs/heads/master from Fil Maj [ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=b4236b9 ] [CB-4198] bin/create script should be better at handling non-word characters in activity name. Patched windows script as well. > cordova platform add android fails due to unexpected error > ---------------------------------------------------------- > > Key: CB-4198 > URL: https://issues.apache.org/jira/browse/CB-4198 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: Master, 2.9.0, 3.0.0 > Environment: Mac OSX 10.7.5 > cordova version 2.9.5 > android sdk tools 22.0.1 > android sdk platform-tools 17 > android sdk built-tools 17 > android 4.2.2 (API 17) > Reporter: Glenn Snyder > Assignee: Filip Maj > Labels: android, platform > Fix For: 3.1.0 > > > Was following the cordova command line tutorial, as part of the PhoneGap overview, found here: > http://docs.phonegap.com/en/2.9.0/guide_cli_index.md.html#The%20Cordova%20Command-line%20Interface > When I tried to execute the step to add the android platform, e.g. > cordova platform add android > I received the error, > An unexpected error occurred: "$ANDROID_BIN" create project --target 1 --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY >&/dev/null exited with 1 > Deleting project... > I then ran the command in debug mode to get more details, e.g. > cordova -d platform add android > and received the output, > cordova library for "android" already exists. No need to download. Continuing. > Checking if platform "android" passes minimum requirements... > Checking Android requirements... > Running "android list target" (output to follow) > Available Android targets: > ---------- > id: 1 or "android-17" > Name: Android 4.2.2 > Type: Platform > API level: 17 > Revision: 2 > Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in > ABIs : armeabi-v7a, mips, x86 > ---------- > id: 2 or "Google Inc.:Google APIs:17" > Name: Google APIs > Type: Add-On > Vendor: Google Inc. > Revision: 3 > Description: Android + Google APIs > Based on Android 4.2.2 (API level 17) > Libraries: > * com.google.android.media.effects (effects.jar) > Collection of video effects > * com.android.future.usb.accessory (usb.jar) > API for USB Accessories > * com.google.android.maps (maps.jar) > API for Google Maps > Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA800 (default), QVGA, WXGA800 > ABIs : armeabi-v7a > Running "android update project -p "/Users/gsnyder/.cordova/lib/android/cordova/2.9.0/framework" -t android-17" (output to follow)... > Updated project.properties > Updated local.properties > build.xml: Found version-tag: custom. File will not be updated. > Updated file /Users/gsnyder/.cordova/lib/android/cordova/2.9.0/framework/proguard-project.txt > It seems that there are sub-projects. If you want to update them > please use the --subprojects parameter. > Running bin/create for platform "android" with command: ""/Users/gsnyder/.cordova/lib/android/cordova/2.9.0/bin/create" "/Users/gsnyder/projects/HelloWorld/platforms/android" "com.example.hello" "Hello World"" (output to follow) > TARGET: 2; PROJECT_PATH: /Users/gsnyder/projects/HelloWorld/platforms/android; PACKAGE: com.example.hello; ACTIVITY: Hello World > An unexpected error occurred: "$ANDROID_BIN" create project --target 1 --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY >&/dev/null exited with 1 > Deleting project... > Error: An error occured during creation of android sub-project. > An unexpected error occurred: "$ANDROID_BIN" create project --target 1 --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY >&/dev/null exited with 1 > Deleting project... > at /usr/local/lib/node_modules/cordova/src/platform.js:231:35 > at /usr/local/lib/node_modules/cordova/node_modules/shelljs/shell.js:1707:7 > at ChildProcess.exithandler (child_process.js:636:7) > at ChildProcess.EventEmitter.emit (events.js:98:17) > at maybeClose (child_process.js:730:16) > at Process.ChildProcess._handle.onexit (child_process.js:797:5) > I modified the "create" script to show what the values were for TARGET, PROJECT_PATH, PACKAGE, and ACTIVITY. I then began experimenting with running the "android create project" command directly and found that the use of a space in the ACTIVITY parameter was causing the command to fail. After removing the space from the ACTIVITY parameter the command completed successfully. Here's the command I used, e.g. > android create project --target 2 --path /Users/gsnyder/projects/HelloWorld/platforms/android --package com.example.hello --activity "HelloWorld" > and the output I received, > Created project directory: /Users/gsnyder/projects/HelloWorld/platforms/android > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/src/com/example/hello > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/src/com/example/hello/HelloWorld.java > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/bin > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/libs > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/values > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/res/values/strings.xml > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/layout > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/res/layout/main.xml > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/drawable-xhdpi > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/drawable-hdpi > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/drawable-mdpi > Created directory /Users/gsnyder/projects/HelloWorld/platforms/android/res/drawable-ldpi > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/AndroidManifest.xml > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/build.xml > Added file /Users/gsnyder/projects/HelloWorld/platforms/android/proguard-project.txt > Does this mean that the tutorial should be using a space in the creation of the project? Or, does this mean that the "create" script which issues the platform creation command is taking the ACTIVITY parameter from the wrong place? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira