问题描述
我在Windows成功下载煎茶命令v4.0.4.84,煎茶touch2.4.0商业,并且已经安装红宝石1.9.3p545并安装了青菜和指南针和蚂蚁和jdk安装1.7并设置类路径,路径7 64位机器。
I have downloaded sencha command v4.0.4.84 , sencha touch2.4.0-commercial and have installed ruby 1.9.3p545 and installed sass and compass and ant and installed jdk 1.7 and set classpath ,path successfully in my windows 7 64 bit machine.
PS:我面临的问题是无法生成从煎茶触摸示例项目的Android框架项目
PS : The problem i am facing is to Unable to generate android skeleton project from sencha touch example project.
步骤我都试过
-
提取的煎茶触摸2.4.0 -commerical然后在命令提示符下执行以下命令
Extracted the sencha touch 2.4.0 -commerical and then in the command prompt executed the following command
D:\\ firstapp \\触摸2.4.0商业\\ FirstApp>煎茶生成应用firstApp ../ FirstApp
2)现在我已经从senchatouch复制的KitchenSink示例文件,并替换(粘贴)在FirstApp的内容。
3)然后执行以下命令来更新应用程序
煎茶应用刷新
3) Then executed the following command to refresh the app sencha app refresh
4)然后我创建密钥工具,如下图所示
C:\\ Program Files文件(x86)的\\的Java \\ jjdk1.7 \\ BIN>的keytool -genkey -v -keystore D:\\ firstapp \\触摸2.4.0商业\\ firstapp.keystore -alias SAN -keyalg RSA - 密钥长度2048 -validity 10000
4) Then I have created keytool as shown below C:\Program Files (x86)\Java\jjdk1.7\bin>keytool -genkey -v -keystore D:\firstapp\touch-2.4.0-commercial\firstapp.keystore -alias san -keyalg RSA -keysize 2048 -validity 10000
5)现在我已经更新packager.json的内容和有我喂证书路径和它的密码,别名和Android SDK中的路径。
Packager.json的内容
5) Now I have updated the content of packager.json and there i fed the certificate path and it's password and alias name and android sdk path .Content of Packager.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":"My Application",
/**
* @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.mycompany.myAppID",
/**
* @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/IconMatrix.html
*
* For Android, please refer to the Google Launcher icons guide:
* http://developer.android.com/design/style/iconography.html
*
* iOS 7 uses 60, 76, 120, 152 (29, 58 for the Settings app; 40, 80 for Spotlight search results).
* iOS 6.1 and earlier uses 57, 72, 114, 144 (29, 58 for the Settings app, for Spotlight search results on iPhone; 50 and 100 for Spotlight search results on iPad).
* Android uses 36, 48, 72, 96.
* If you package for Android you can ignore iOS icons and vice versa.
*/
"icon": {
"60":"resources/icons/Icon.png",
"120":"resources/icons/[email protected]",
"76":"resources/icons/Icon~ipad.png",
"152":"resources/icons/[email protected]",
"36":"resources/icons/Icon-36.png",
"48":"resources/icons/Icon-48.png",
"96":"resources/icons/Icon-96.png",
"57":"resources/icons/Icon-57.png",
"114":"resources/icons/[email protected]",
"72":"resources/icons/Icon-72.png",
"144":"resources/icons/[email protected]",
"29":"resources/icons/Icon-Small.png",
"58":"resources/icons/[email protected]",
"40":"resources/icons/Icon-Small-40.png",
"80":"resources/icons/[email protected]",
"50":"resources/icons/Icon-Small-50.png",
"100":"resources/icons/[email protected]"
},
/**
* @cfg {String} inputPath
* @required
* This is location of your Sencha Touch 2 application, relative to this configuration file.
*/
"inputPath":"./",
/**
* @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":"../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":"Android",
/**
* @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":"D:/firstapp/touch-2.4.0-commercial/testapp/my-release-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.
*/
"certificateAlias":"san",
/**
* @cfg {String} certificatePassword
* The password which was specified during certificate export
*/
"certificatePassword":"san12345",
/**
* @cfg {String} provisionProfile
* The path to the provision profile (APP_NAME.mobileprovision) which you can create and then download from Apple's provisioning portal
*/
"provisionProfile":"",
/**
* @cfg {String} URLScheme
* URL scheme for communication with your application, can be empty if you don't use custom URL scheme in your project.
*/
"URLScheme":"",
/**
* @cfg {String} notificationConfiguration
* Notification configuration for push notifications, can be "debug", "release" or empty if you don't use push notifications in your project.
*/
"notificationConfiguration":"",
/**
* @cfg {String} sdkPath
* This is the path to the Android SDK, if you are developing an Android application.
*/
"sdkPath":"C:/Android/adt-bundle-windows-x86/sdk",
/**
* @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"
]
}
6)之后,我已经执行以下命令
D:\\ firstapp \\触摸2.4.0商业\\ FirstApp>煎茶应用程序包生成packager.json
所有我的Android directortes即当您在下面的图片可以看到Android的框架项目创建
一旦我得到了以下错误,所有我的Android文件结构都不见了I M获得
Once I got the following error , all my android files structures were gone i m getting
stbuild退出与非零误差code:7
stbuild exited with non zero error code:7
全stact跟踪:
D:\firstapp\touch-2.4.0-commercial\FirstApp>sencha app package build packager.js
on
Sencha Cmd v4.0.4.84
[ERR]
Created directory D:\firstapp\touch-2.4.0-commercial\build\src\com\mycompany\myA
ppID
Added file D:\firstapp\touch-2.4.0-commercial\build\src\com\mycompany\myAppID\ST
Activity.java
Created directory D:\firstapp\touch-2.4.0-commercial\build\res
Created directory D:\firstapp\touch-2.4.0-commercial\build\bin
Created directory D:\firstapp\touch-2.4.0-commercial\build\libs
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\values
Added file D:\firstapp\touch-2.4.0-commercial\build\res\values\strings.xml
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\layout
Added file D:\firstapp\touch-2.4.0-commercial\build\res\layout\main.xml
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\drawable-xhdpi
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\drawable-hdpi
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\drawable-mdpi
Created directory D:\firstapp\touch-2.4.0-commercial\build\res\drawable-ldpi
Added file D:\firstapp\touch-2.4.0-commercial\build\AndroidManifest.xml
Added file D:\firstapp\touch-2.4.0-commercial\build\build.xml
Added file D:\firstapp\touch-2.4.0-commercial\build\proguard-project.txt
A subdirectory or file ..\build\\\libs\ already exists.
A subdirectory or file ..\build\\\assets\ already exists.
Unable to locate tools.jar. Expected to find it in C:\Program Files (x86)\Java\j
re7\lib\tools.jar
Buildfile: D:\firstapp\touch-2.4.0-commercial\build\build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 21.0.1
[checkenv] Installed at C:\Android\adt-bundle-windows-x86\sdk
-setup:
[echo] Project Name: MyApplication
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-build-setup:
[echo] Resolving Build Target for MyApplication...
[gettarget] Project Target: Android 4.2
[gettarget] API level: 17
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: D:\firstapp\touch-2.4.0-commercial\build\bin\res
[mkdir] Created dir: D:\firstapp\touch-2.4.0-commercial\build\gen
[mkdir] Created dir: D:\firstapp\touch-2.4.0-commercial\build\bin\classes
[mkdir] Created dir: D:\firstapp\touch-2.4.0-commercial\build\bin\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for MyApplication...
[dependency] Library dependencies:
[dependency] No Libraries
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-pre-build:
-code-gen:
[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...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] D:\firstapp\touch-2.4.0-commercial\build\bin\AndroidManifest.xml:11:
error: Error: No resource found that matches the given name (at 'icon' with val
ue '@drawable/icon').
BUILD FAILED
C:\Android\adt-bundle-windows-x86\sdk\tools\ant\build.xml:647: The following err
or occurred while executing this line:
C:\Android\adt-bundle-windows-x86\sdk\tools\ant\build.xml:688: null returned: 1
Total time: 2 seconds
""C:/Android/adt-bundle-windows-x86/sdk\tools\android" create project --target a
ndroid-17 --name MyApplication --activity STActivity --path "../build/\/" --pack
age com.mycompany.myAppID"
Could not run ant with error: 1
Failed to package application
[ERR] stbuild exited with non-zero code : 7
D:\firstapp\touch-2.4.0-commercial\FirstApp>
更新
由于Mr.Martin在指向正确的方向,我已经通过添加以下行packager.json解决了该问题的iconName:的icon.png,
推荐答案
在构建过程失败,因为它忽略了一个图标。这是通过以下行连通
The build process fails, because it misses an icon. This is communicated by the following line:
[aapt] D:\firstapp\touch-2.4.0-commercial\build\bin\AndroidManifest.xml:11:
error: Error: No resource found that matches the given name (at 'icon' with val
ue '@drawable/icon').
我没有用煎茶Cmd的建设的PhoneGap项目,但(我用的PhoneGap直接),所以我不知道哪个图标丢失或你有你的packager.json文件提供什么名字。
但错误说,AAPT正在寻找一个名为'的icon.png的图标。你有没有在你的packager.json提供该图标。
I haven't used Sencha Cmd to build a phonegap project yet (I use phonegap directly) so I have no idea which icon is missing or what names you have to provide in your packager.json file. But the error says that aapt is looking for an icon that is named 'icon.png'. You have not provided this icon in your packager.json.
请确保所有的图标都在你的资源/文件夹的图标,并正确命名。
Make sure that all icons are in your resources/icons folder and are named correctly.
这篇关于无法生成因为stbuild的煎茶触摸的Android框架项目退出非零code:7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!