首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >试图安装ios-部署时出错

试图安装ios-部署时出错
EN

Stack Overflow用户
提问于 2015-07-31 22:51:44
回答 4查看 1.5K关注 0票数 2

我使用的是离子框架,但是当我想在设备上运行我的应用程序时,我需要安装ios-deploy,但是当我尝试安装它时,当我运行时会出现以下错误

代码语言:javascript
复制
npm install -g ios-deploy

这是一个错误:

代码语言:javascript
复制
> ios-deploy@1.7.0 preinstall /usr/local/lib/node_modules/ios-deploy
> make ios-deploy

gcc -ObjC -g -o ios-deploy -framework Foundation -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks ios-deploy.c
In file included from ios-deploy.c:4:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' after @class
@class NSArray<ObjectType>;
              ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: error: cannot find protocol declaration for 'ObjectType'
@class NSArray<ObjectType>;
               ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: error: cannot find protocol declaration for 'ObjectType'
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                        ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected identifier or '('
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
                                    ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:13: error: expected ')'
- (nullable ObjectType)nextObject;
            ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:3: note: to match this '('
- (nullable ObjectType)nextObject;
  ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:25: error: cannot find protocol declaration for 'ObjectType'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                        ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:1: error: duplicate interface definition for class 'NSEnumerator'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:12: note: previous definition is here
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
           ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:37: error: method type specifier must start with '-' or '+'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                    ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:38: error: expected a type
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
                                     ^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected selector for Objective-C method
@property (readonly, copy) NSArray<ObjectType> *allObjects;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:36: error: cannot find protocol declaration for 'ObjectType'
@property (readonly, copy) NSArray<ObjectType> *allObjects;
                                   ^
In file included from ios-deploy.c:4:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:32: error: cannot find protocol declaration for 'ObjectType'
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                               ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected identifier or '('
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
                                           ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: expected a type
- (ObjectType)objectAtIndex:(NSUInteger)index;
   ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')'
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                       ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:33: note: to match this '('
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
                                ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:20: error: cannot find protocol declaration for 'ObjectType'
@interface NSArray<ObjectType> (NSExtendedArray)
                   ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:1: error: duplicate interface definition for class 'NSArray'
@interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:12: note: previous definition is here
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
           ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:32: error: method type specifier must start with '-' or '+'
@interface NSArray<ObjectType> (NSExtendedArray)
                               ^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:33: error: expected a type
@interface NSArray<ObjectType> (NSExtendedArray)
                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ios-deploy] Error 1
npm ERR! Darwin 15.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "ios-deploy"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ELIFECYCLE

npm ERR! ios-deploy@1.7.0 preinstall: `make ios-deploy`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the ios-deploy@1.7.0 preinstall script 'make ios-deploy'.
npm ERR! This is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make ios-deploy
npm ERR! You can get their info via:
npm ERR!     npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Robin/npm-debug.log

如何纠正此错误?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2015-08-31 18:20:03

此问题正在phonegap/ios-部署存储库中作为第161期进行跟踪。在大多数情况下,问题是由运行或安装Xcode 7 Beta引起的。总之,命令行工具和项目编译设置似乎不同步,导致错误版本的库被链接,并且出现了这个问题。

解决方案的最佳选择是找到在网络智慧的评论中。总结如下:

  1. 进入Xcode首选项,检查命令行工具的版本集。
  2. 从终端运行xcodebuild -version
  3. 确认这两个版本是同步的。根据需要调整Xcode中的版本。
  4. 使用以下内容链接动态库位置:cd /Applications/Xcode-beta.app (or wherever your Xcode 7 beta is located) cd Contents/Developer/Platforms/iPhoneSimulator.platform cd Developer/SDKs/iPhoneSimulator.sdk/usr/lib sudo mv dyld_sim dyld_sim.rig

这对我有用,YMMV

票数 0
EN

Stack Overflow用户

发布于 2016-01-30 17:58:15

我也遇到过同样的问题。然后我发现他的答案解决了我的问题。应答带来ios-动态部署

只需尝试:

代码语言:javascript
复制
npm install -g ios-deploy --unsafe-perm=true
票数 3
EN

Stack Overflow用户

发布于 2015-07-31 22:57:26

你用sudo命令试过了吗?当我不使用sudo的时候,我总是有这个问题

代码语言:javascript
复制
sudo npm install -g ios-deploy
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31756338

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档