离子平台添加android-包名必须如下:com.company.Name [英] ionic platform add android- Package name must look like: com.company.Name

查看:924
本文介绍了离子平台添加android-包名必须如下:com.company.Name的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始开发离子应用程序,我按照 http://ionicframework.com/docs/guide/中的指南进行操作installation.html

Im getting started in developing ionic app, I followed the guide in http://ionicframework.com/docs/guide/installation.html

以防万一:命令ionic platform add ios有效,我安装了android sdk。

just in case: the command "ionic platform add ios" works and i have android sdk installed.

当输入命令ionic platform add android时,我收到此错误:

when typing the command "ionic platform add android" i get this error:

Adding android project...

/Users/LihaiMac/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin/node_modules/q/q.js:126
                throw e;
                      ^
Package name must look like: com.company.Name
Error: /Users/LihaiMac/.cordova/lib/npm_cache/cordova-android/3.7.1/package/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

我尝试在其他相关帖子中搜索答案,但没有成功..
我会感谢任何帮助解决我的问题..

I tried searching an answer in other related posts, but not successful.. I'll appreciate any help in solving my problem..

推荐答案

mladen5说的是正确的。您需要转到Cordova / Phonegap项目的config.xml并编辑ID以满足包名称期望。

What mladen5 said is correct. You need to go to the config.xml of your Cordova/Phonegap project and edit the id to meet the package name expectations.

该名称可在ID属性中找到并且在下面的示例配置中是com.mydomainhere.appnamehere:

The name can be found in the ID property and is "com.mydomainhere.appnamehere" in the example config below:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.mydomainhere.appnamehere" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Awesome app</name>
    <description>
        The worlds most awesome app
    </description>
    <author email="your@email.com" href="http://www.anurlhere.com">
        Author name
    </author>
    <content src="index.html" />
    <access origin="*" />
</widget>

这篇关于离子平台添加android-包名必须如下:com.company.Name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆