我曾经在我现在的相同设置上构建并运行它在iPhone 4s上进行测试并且它工作正常,现在我正在尝试在iPhone 5S上运行它进行测试,但它不起作用。 / p>
Phonegap GAplugin和arm64存在一个已知问题,我曾使用arm64从目标中的有效架构中移除arm64。
我第一次尝试时遇到以下错误:
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=armv7 armv7s).
我将目标上的“仅构建活动架构”更改为“否”,然后我收到以下错误:
Undefined symbols for architecture armv7:
"_CDVPageDidLoadNotification", referenced from:
-[CDVSplashScreen pluginInitialize] in CDVSplashScreen.o
"_OBJC_CLASS_$_CDVWebViewDelegate", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_OBJC_METACLASS_$_CDVPlugin", referenced from:
_OBJC_METACLASS_$_GAPlugin in GAPlugin.o
_OBJC_METACLASS_$_IonicKeyboard in IonicKeyboard.o
_OBJC_METACLASS_$_CDVBarcodeScanner in CDVBarcodeScanner.o
_OBJC_METACLASS_$_DFPPlugin in DFPPlugin.o
_OBJC_METACLASS_$_PushNotification in PushNotification.o
_OBJC_METACLASS_$_SocialSharing in SocialSharing.o
_OBJC_METACLASS_$_CDVDevice in CDVDevice.o
...
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
objc-class-ref in CDVDevice.o
l_OBJC_$_CATEGORY_CDVViewController_$_StatusBar in CDVStatusBar.o
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVUserAgentUtil", referenced from:
objc-class-ref in CDVInAppBrowser.o
"_CDVRemoteNotification", referenced from:
-[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_CLASS_$_CDVPlugin", referenced from:
_OBJC_CLASS_$_GAPlugin in GAPlugin.o
_OBJC_CLASS_$_IonicKeyboard in IonicKeyboard.o
_OBJC_CLASS_$_CDVBarcodeScanner in CDVBarcodeScanner.o
_OBJC_CLASS_$_DFPPlugin in DFPPlugin.o
_OBJC_CLASS_$_PushNotification in PushNotification.o
_OBJC_CLASS_$_SocialSharing in SocialSharing.o
_OBJC_CLASS_$_CDVDevice in CDVDevice.o
...
"_CDVRemoteNotificationError", referenced from:
-[AppDelegate application:didFailToRegisterForRemoteNotificationsWithError:] in AppDelegate.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:openURL:sourceApplication:annotation:] in AppDelegate.o
-[CDVInAppBrowser openInSystem:] in CDVInAppBrowser.o
-[FacebookConnectPlugin initWithWebView:] in FacebookConnectPlugin.o
"_OBJC_CLASS_$_CDVPluginResult", referenced from:
objc-class-ref in GAPlugin.o
objc-class-ref in CDVBarcodeScanner.o
objc-class-ref in DFPPlugin.o
objc-class-ref in PushNotification.o
objc-class-ref in SocialSharing.o
objc-class-ref in CDVDevice.o
objc-class-ref in CDVNotification.o
...
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
奇怪的是,我仍然可以使用“cordova run ios”在新设置上测试应用程序,但我无法构建它以便发布!我该怎么办?
Cordova版本:4.1.2
Xcode版本:6.1
测试设备:iOS 5的iPhone 5S
Cordova插件
答案 0 :(得分:4)
有同样的问题......可能是一个过时的Xcode项目。我只是运行这些命令:
cordova platform remove ios
cordova platform add ios
然后,打开新的Xcode项目并运行。它对我有用!
答案 1 :(得分:0)
我使用的是iPhone 4s模拟器,一切正常。然后我断开了我的iPhone 5s并存档了应用程序。
所以,我认为没有办法只通过Xcode在开发的iPhone 5S上运行ARMV7架构,但你可以通过“cordova run ios”来实现这一点
答案 2 :(得分:0)
我认为你的问题是你在myapp / www / index.html中编写代码(这是cordova运行android或cordova运行ios等的路径)。
如果你想通过XCode或Eclipse(Android)进行构建,你应该在myapp / platforms / ios / www / index.html中编写你的代码
显然复制所有必要的文件(js和css和图像,全部!)来运行你的应用程序,然后在XCode中创建一个项目
这些是Phonegap的两种方法(基于Cli和多平台或特定平台)
希望它有所帮助!