Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with Cordova iOS 4 #24

Open
studio31 opened this issue Mar 22, 2016 · 4 comments
Open

Not compatible with Cordova iOS 4 #24

studio31 opened this issue Mar 22, 2016 · 4 comments

Comments

@studio31
Copy link

I'm having this issue:

/applewatch/watch/platforms/ios/HelloCordova/Plugins/cordova-plugin-applewatch/AppDelegate+applewatch.m:49:25: 
No visible @interface for 'UIView' declares the selector 'stringByEvaluatingJavaScriptFromString:'

It seems you fixed it in other of your plugins:
EddyVerbruggen/cordova-plugin-3dtouch#7

Thanks for the great work, and I'm very excited to test it so I think for now I will try to build it in Cordova iOS 3.x

@studio31
Copy link
Author

For anyone having problems trying to use the plugin with the latest Cordova and Xcode, these are the steps I follow to make the demo work:

cordova create applewatchtest
cd applewatchtest
npm install xcode
cordova platform add [email protected]

Use Cordova iOS 3.9.2 because the plugin is not compatible with version 4.

Xcode
Open the project in Xcode and do:
File > New > Target > wachOS > Application > Watchkit App for watchOS
Select language ObjC, Select Glance and Notifications > Finish > Activate

cordova plugin add https://github.com/Telerik-Verified-Plugins/AppleWatch
cordova prepare

After installing the plugin you should get something like this:

Added source file DetailInterfaceController.m to HelloCordova WatchKit 1 Extension
Added source file OneColumnRowType.m to HelloCordova WatchKit 1 Extension
Added source file OneColumnSelectableRowType.m to HelloCordova WatchKit 1 Extension
Added source file ParentInterfaceController.m to HelloCordova WatchKit 1 Extension
Added source file TwoColumnsRowType.m to HelloCordova WatchKit 1 Extension
Added source file WatchKitHelper.m to HelloCordova WatchKit 1 Extension
Added source file WatchKitUIHelper.m to HelloCordova WatchKit 1 Extension
Added header file DetailInterfaceController.h to HelloCordova WatchKit 1 Extension
Added header file OneColumnRowType.h to HelloCordova WatchKit 1 Extension
Added header file OneColumnSelectableRowType.h to HelloCordova WatchKit 1 Extension
Added header file ParentInterfaceController.h to HelloCordova WatchKit 1 Extension
Added header file TwoColumnsRowType.h to HelloCordova WatchKit 1 Extension
Added header file WatchKitHelper.h to HelloCordova WatchKit 1 Extension
Added header file WatchKitUIHelper.h to HelloCordova WatchKit 1 Extension
Copied Interface.storyboard to HelloCordova WatchKit 1 App
Changed debug and release deployment targets of HelloCordova WatchKit 1 App to 8.2

XCode again

  1. Set CFBundleVersion (Bundle Version) and CFBundleShortVersionString (Bundle versions string, short) of all targets to the same value (use XCode's search feature COMMAND + SHIFT + F and change all 3 .plist values)
  2. App Groups: register an appgroup in your iOS member center (Identifiers > App Groups): we expect group., like group.io.cordova.hellocordova, then add it to your App ID. Now generate a provisioning profile with the new App ID and add it XCode (download, then double-click the file should do it). In XCode, go to your targets and add this app group to both the phone and watch app targets (Capabilities tab).
  3. Set bitcode to NO for all 3 targets. Go to 'Build Settings' and disable it 3 times.

Done, ready to build and test!

TIP:
If the build failed with an error like this one:

ld: library not found for -lmmwormhole
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Use this to solve it:
#14 (comment)

Deselect and select again the targets, clean the project and build it again.

@compelling
Copy link

compelling commented May 20, 2017

I've forked the plugin, merged corrections made by @EddyVerbruggen to the 3d touch plugin into this one. It compiles fine now. However, i get a black screen when using the plugin under WatchOS 3... se also #37

@ustincameron
Copy link

@compelling Any progress here? I'm trying to add this plugin to my Ionic/Cordova app to no avail.

`cli packages: (/Users/Admin/desktop/Watch_Test_App/node_modules)

@ionic/cli-utils  : 1.8.1
ionic (Ionic CLI) : 3.8.1

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0

System:

ios-deploy : 1.9.1 
Node       : v6.10.1
npm        : 5.3.0 
OS         : OS X El Capitan
Xcode      : Xcode 8.2.1 Build version 8C1002`

@compelling
Copy link

Nope, spent about a week trying to get it to work back in may, have given up on the plugin. Havn't checked if someone's made changes since then though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants