0

我尝试使用本教程为 Android 平台构建一个示例 Sencha 应用程序:http ://docs.sencha.com/touch/2-0/#!/guide/native_android 。

我完成了所有步骤(1、2、3),现在尝试构建一个 *.apk 文件:

sencha --debug package build config.json

我有一个奇怪的输出,尝试访问带有重复片段“\assets\build”的极长路径:

C:\all\GS\build\\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\app\controller\C:\all\GS\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\app\controller\

有谁知道为什么会发生?路径开头有两个反斜杠似乎很奇怪,但我不知道为什么。

我的 config.json 是:

{
    /**
     * @cfg {String} applicationName
     * @required
     * This is the name of your application, which is displayed on the device when the app is installed. On IOS, this should match
     * the name of your application in the Apple Provisioning Portal.
     */
    "applicationName":"FirstApp",

    "iconName": "C:/all/GS/resources/icons/Icon.png",

    /**
     * @cfg {String} applicationId
     * This is the name namespace for your application. On IOS, this should match the name of your application in the Apple Provisioning Portal.
     */
    "applicationId":"com.ergosolo.firstApp",

    /**
     * @cfg {String} bundleSeedId
     * A ten character string which stands before aplication ID in Apple Provisioning Portal
     */
    "bundleSeedId":"KPXFEPZ6EF",

    /**
     * @cfg {String} versionString
     * @required
     * This is the version of your application.
     */
    "versionString":"1.0",

    /**
     * @cfg {Integer} versionCode
     * @required
     * This is the integer version code of your application, or you can refer to it as a build number. Used only for Android builds.
     */
    "versionCode":"1",

    /**
     * @cfg {Object} icon
     * For iOS, please refer to their documentation about icon sizes:
     * https://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html
     *
     * For Android, please refer to the Google Launcher icons guide:
     * http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
     */
    "icon": {
        "57":"resources/icons/Icon.png",
        "72":"resources/icons/Icon~ipad.png",
        "114":"resources/icons/Icon@2x.png",
        "144":"resources/icons/Icon~ipad@2x.png"
    },

    /**
     * @cfg {String} inputPath
     * @required
     * This is location of your Sencha Touch 2 application, relative to this configuration file.
     */
    "inputPath":"C:/all/GS",

    /**
     * @cfg {String} outputPath
     * @required
     * This is where the built application file with be saved. Make sure that output path is not in your input path, you may get into endless recursive copying
     */
    "outputPath":"C:/all/GS/build",

    /**
     * @cfg {String} configuration
     * @required
     * This is configuration for your application. `Debug` should always be used unless you are submitting your app to an online
     * store - in which case `Release` should be specified.
     */
    "configuration":"Debug",

    /**
     * @cfg {String} platform
     * @required
     * This is the platform where you will be running your application. Available options are:
     *  - iOSSimulator
     *  - iOS
     *  - Android
     *  - AndroidEmulator
     */
    "platform":"AndroidEmulator",

    /**
     * @cfg {String} deviceType
     * @required
     * This is device type that your application will be running on.
     *
     * If you are developing for Android, this is not necessary.
     *
     * Available options are:
     *  - iPhone
     *  - iPad
     *  - Universal
     */
    "deviceType":"Universal",

    /**
     * @cfg {String} certificatePath
     * This is the location of your certificate.
     * This is required when you are developing for Android or you are developing on Windows.
     */
    "certificatePath":"C:/all/GS/my-debug-key.keystore",

    /**
     * @cfg {String} certificateAlias
     * This is the name of your certificate.
     *
     * IF you do not specify this on OSX, we will try and automatically find the certificate for you using the applicationId.
     *
     * This can be just a simple matcher. For example, if your certificate name is "iPhone Developer: Robert Dougan (ABCDEFGHIJ)", you
     * can just put "iPhone Developer".
     *
     * When using a certificatePath on Windows, you do not need to specify this.
     */
    "certificatePassword":"",
    /**
     * @cfg {String} certificatePassword
     * The password which was specified during certificate export
     */
    "provisionProfile":"",
    /**
     * @cfg {String} provisionProfile
     * The path to the provision profile (APP_NAME.mobileprovision) which you can create and then download from Apple's provisioning portal
     */
    "sdkPath":"C:/Users/sergzach/Desktop/adt-bundle-windows-x86/adt-bundle-windows-x86/sdk",

    /**
     * @cfg {String} sdkPath
     * This is the path to the Android SDK, if you are developing an Android application.
     */

    /**
    /**
     * @cfg {String} androidAPILevel
     * This is android API level, the version of Android SDK to use, you can read more about it here: http://developer.android.com/guide/appendix/api-levels.html.
     * Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android)
     */
    "androidAPILevel":"17",

    /**
    /**
     * @cfg {Array[String]} permissions
     * Array of permissions that is used by an application (Android only) 
     * Full list of permissions for Android application can be found here: http://developer.android.com/reference/android/Manifest.permission.html#ACCESS_CHECKIN_PROPERTIES
     */
    "permissions":[
                    "INTERNET",
                    "ACCESS_NETWORK_STATE",
                    "CAMERA",
                    "VIBRATE",
                    "ACCESS_FINE_LOCATION",
                    "ACCESS_COARSE_LOCATION",
                    "CALL_PHONE"],

    /**
     * @cfg {Array[String]} orientations
     * @required
     * This is orientations that this application can run.
     */
    "orientations": [
        "portrait",
        "landscapeLeft",
        "landscapeRight",
        "portraitUpsideDown"
    ]
}

在下一个调试日志的末尾,它说文件名或其扩展名太长。然后它说路径“C:\all\GS\build\assets\build\assets..”太长了。

The full debug(我是从俄语手动翻译的,所以它不能对应确切的英文信息)。

Sencha Cmd v3.0.0.250
[DBG]       using path C:\Program Files\Sencha\Cmd\3.0.0.250\stbuild;C:\Program Files\Sencha\Cmd\3.0.0.250\stbuild\bin;C:\Program Files\Sencha\Cmd\3.0.0.250;C:\all\sencha-projects;C:\Program Files\SenchaSDKTools-2.0.0-beta3\compat\scripts;C:\Program Files\SenchaSDKTools-2.0.0-beta3\compat\command;C:\Program Files\SenchaSDKTools-2.0.0-beta3\compat\jsbuilder;C:\Program Files\SenchaSDKTools-2.0.0-beta3\bin;C:\Program Files\SenchaSDKTools-2.0.0-beta3;C:\Program Files\AMD APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\8.4\bin\;C:\Python26\Scripts;C:\Python26;C:\Program Files\ImageMagick-6.6.7-Q16;C:\all\start;C:\all\trunk\www\cometd\cometd-twisted;C:\Program Files\nodejs\;C:\Users\sergzach\AppData\Roaming\npm\
[DBG]       executable located at C:\Program Files\Sencha\Cmd\3.0.0.250\stbuild\stbuild.exe
[DBG]       using workding directory .
Error: Project folder 'C:\all\GS\build' is not empty. Please consider using 'android.bat update' instead.
Updated file C:\all\GS\build\src\com\ergosolo\firstApp\STActivity.java
Updated file C:\all\GS\build\res\values\strings.xml
Updated file C:\all\GS\build\res\layout\main.xml
Updated file C:\all\GS\build\AndroidManifest.xml
Updated file C:\all\GS\build\build.xml
Updated file C:\all\GS\build\proguard-project.txt
Subfolder or file C:\all\GS\build\\assets\ already exists.
Subfolder or file C:\all\GS\build\\assets\.sencha\ already exists.
Subfolder or file C:\all\GS\build\\assets\.sencha\app\ already exists.
Subfolder or file C:\all\GS\build\\assets\.sencha\workspace\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\controller\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\model\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\profile\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\store\ already exists.
Subfolder or file C:\all\GS\build\\assets\app\view\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\assets\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\assets\.sencha\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\assets\.sencha\app\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\assets\.sencha\workspace\ already exists.
Subfolder or file C:\all\GS\build\\assets\build\assets\app\ already exist.
...( and so on, truncated)
The name of the file or it's extention has incorrect length..
The name of the file or it's extention has incorrect length..
The name of the file or it's extention has incorrect length..
The next path is too long: "C:\all\GS\build\\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\app\controller\C:\all\GS\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\build\assets\app\controller\".
[DBG]       exit code was : -1073741819
[DBG]       exit code was : -1073741819

如果我将 outputPath 更改为 'build/' 那么它是具有极长路径的相同输出: C:/all/GS\build\assets\build\assets\build\assets... (在最后一种情况下没有双反斜杠)。

4

1 回答 1

1

问题已解决。输出 'build' 目录不应与源文件目录具有相同的根目录(dirs 'app', 'resources', 'files')

于 2012-12-11T10:02:27.463 回答