Meteor`请添加Android平台`但接下来`平台android已添加'

时间:2017-05-14 21:46:44

标签: android cordova meteor

来源

我做教程:

  

https://www.meteor.com/tutorials/blaze/running-on-mobile

错误

我正在执行命令:

 meteor run android-device

获取我应该添加android平台

的信息
Please add the Android platform to your project first.
Run: meteor add-platform android  

但是当我运行命令时:

meteor add-platform android --verbose

然后我发现混淆错误,表明平台android已添加

Adding platform Android to Cordova project    
%% No scripts found for hook "before_platform_add".
=> Errors executing Cordova commands:         

   While adding platform Android to Cordova project:
   Cordova error: Platform android already added.
   at /home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/cordova-lib/src/cordova/platform.js:130:31
   at _fulfilled (/home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:787:54)
   at self.promiseDispatch.done (/home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:816:30)
   at Promise.promise.promiseDispatch (/home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:749:13)
   at /home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:557:44
   at flush (/home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/q/q.js:108:17)
   at nextTickCallbackWith0Args (node.js:489:9)
   at process._tickCallback (node.js:418:13)
   => awaited here:
   at Function.Promise.await
   (/home/daniel/.meteor/packages/meteor-tool/.1.4.3_2.18ygcop++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:35:12)
   at CordovaProject.runCommands (/tools/cordova/project.js:715:22)
   at CordovaProject.addPlatform (/tools/cordova/project.js:372:10)
   at CordovaProject.ensurePlatformsAreSynchronized (/tools/cordova/project.js:403:12)
   at /tools/cli/commands-cordova.js:60:20
   at /tools/utils/buildmessage.js:271:13
   at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
   at /tools/utils/buildmessage.js:264:29
   at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
   at /tools/utils/buildmessage.js:262:18
   at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
   at /tools/utils/buildmessage.js:253:23
   at [object Object]._.extend.withValue (/tools/utils/fiber-helpers.js:89:14)
   at Object.capture (/tools/utils/buildmessage.js:252:19)
   at Object.main.captureAndExit (/tools/cli/main.js:271:29)
   at Command.func (/tools/cli/commands-cordova.js:42:8)
   at /tools/cli/main.js:1483:23
   (If the error message contains suggestions for a fix, note that this may not apply to the Meteor integration. You can try running again with the --verbose option to help diagnose the issue.)

其他信息:

智能手机已连接

adb devices
List of devices attached 
b799f64c    device

我的系统信息:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial

NPM

npm -v
3.5.2

纯Cordova编译正常工作

1 个答案:

答案 0 :(得分:1)

如果您手动在.meteor / platforms文件中添加平台,那么可能会出错,所以只需重新添加平台即可。

meteor remove-platform android
meteor add-platform android