PhoneGap的3.0希望机器人17,但我想机器人18 [英] phonegap 3.0 wants android 17, but I want android 18
问题描述
尽管经历过的PhoneGap和X code,我是新来的机器人。 我已经安装的PhoneGap 3.0 ...
NPM安装的PhoneGap
PhoneGap的--version
3.0.0-0.14.3
我已经安装了ADT束-MAC-x86_64-20130729。命令行工具(如:机器人)似乎做工精细。 当我尝试添加Android作为一个平台。
的PhoneGap本地构建Android
我得到...
[错误]请安装Android的目标17(在Android 4.2 SDK)。请确保你已经安装了最新的Android工具,以及。运行`android`从你的命令行安装/更新任何缺少的软件开发工具包或工具。
我看到类似的问题仍然没有答案...... <一href="http://stackoverflow.com/questions/18686368/phonegap-3-0-cli-issue-android-target-number-in-build-app">Phonegap在构建应用 3.0 CLI问题的android目标数
当我安装Android-17正常工作,这是很酷,但我需要使用Android-18这样我就可以用BLE。
我看到费尔显然少将在07月31日修复了这个问题... <一个href="https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=commitdiff;h=c2c5f710">https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=commitdiff;h=c2c5f710
..但我似乎并没有在PhoneGap的我下载的版本修复。我想也许它只是在科尔多瓦,所以我安装了太多,但碰到了同样的问题。
我想在黑客直接包含检查故宫目录的四个JS文件,但没有采取(即:坚持错误)
任何人都可以请建议要么...
1)如何下载一个版本的PhoneGap /科尔多瓦与固定的问题,或
2)如何分辨的PhoneGap /科尔多瓦其中的Android版本,我想定位
太感谢了......
查找在Windows文件 android_parser.js
这是undr路径:
C:\ Users \用户名\应用程序数据\漫游\故宫\ node_modules \科尔多瓦的\ src \元
变更文件android_parse.js
或如果您正在makking从PhoneGap的不科尔多瓦应用程序:
<$p$p><$c$c>C:\Users\USER_NAME\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\metadata\android_parser.js
前往路线: 57
如果(output.indexOf(机器人-17')== -1){
和改变的:
如果(output.indexOf('机器人')== -1){
这会让你不wory对未来:)
但是你可能会发生这种错误
[错误:创造机器人子项目过程中出现错误。
]
要解决它,你将不得不转到这个路径:
C:\ Users \用户名\ .cordova \ lib目录\机器人\科尔多瓦\ 3.1.0 \框架\ project.properties
和改变这一行:
目标=机器人-17
要这样:
目标=机器人-19
或者无论是你的Android SDK版本
做什么,如果你想使用的Android 2.2
只是简单的去为:
Your_Project_Folder /平台/安卓/ AndroidManifest.xml中
和变化:
&LT;使用-SDK安卓的minSdkVersion =10机器人:targetSdkVersion =19/&GT;
要:
&LT;使用-SDK安卓的minSdkVersion =7安卓targetSdkVersion =19/&GT;
和在的导入你的项目,你的IDE
享受:)
While experienced with phonegap and xcode, I'm new to android. I have installed phonegap 3.0 ...
npm install phonegap
phonegap --version
3.0.0-0.14.3
I've installed adt-bundle-mac-x86_64-20130729. The command line tools (eg: android) seem to work fine. When I try to add android as a platform ..
phonegap local build android
I get ...
[error] Please install Android target 17 (the Android 4.2 SDK). Make sure you have the latest Android tools installed as well. Run `android` from your command-line to install/update any missing SDKs or tools.
I see similar questions still unanswered ... Phonegap 3.0 CLI issue android target number in build app
When I do install android-17 it works fine, which is cool, but I need to use android-18 so I can use BLE.
I see that Fil Maj apparently fixed this issue on Jul 31 ... https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=commitdiff;h=c2c5f710
.. but I don't appear to have that fix in the version of phonegap I downloaded. I thought perhaps it was only in cordova, so I installed that too, but ran into the same issue.
I tried hacking the four js files in the npm directories that contain the check directly, but that didn't take (ie: the error persisted).
Can anyone please suggest either ...
1) how to download a version of phonegap/cordova with the problem fixed, or
2) how to tell phonegap/cordova which version of android I'd like to target
Thanks so much ...
Find file android_parser.js
in Windows it is undr path:
C:\Users\USER_NAME\AppData\Roaming\npm\node_modules\cordova\src\metadata
change in file android_parse.js
OR if You are makking application from PhoneGap not Cordova:
C:\Users\USER_NAME\AppData\Roaming\npm\node_modules\phonegap\node_modules\cordova\src\metadata\android_parser.js
go to line: 57
if (output.indexOf('android-17') == -1) {
and change it for:
if (output.indexOf('android') == -1) {
This will let You not to wory about future :)
But then You can occur this Error
[Error: An error occured during creation of android sub-project.
]
To fix it You will have to goto this path:
C:\Users\USER_NAME\.cordova\lib\android\cordova\3.1.0\framework\project.properties
And change this line:
target=android-17
To this:
target=android-19
Or whatever is Your Android SDK version
What to do if You want to use Android 2.2 ?
Just simple go to:
Your_Project_Folder/platforms/android/AndroidManifest.xml
And change:
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
To:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="19" />
And after that import Your project to Your IDE
Enjoy :)
这篇关于PhoneGap的3.0希望机器人17,但我想机器人18的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!