Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
583 views
in Technique[技术] by (71.8m points)

ionic platform add android- Package name must look like: com.company.Name

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

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

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..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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="[email protected]" href="http://www.anurlhere.com">
        Author name
    </author>
    <content src="index.html" />
    <access origin="*" />
</widget>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...