Capacitor: Capacitor isn't managing dependencies correctly

Created on 7 Sep 2019  ·  9Comments  ·  Source: ionic-team/capacitor

Updating from @capacitor/[email protected] to @capacitor/[email protected] WITHOUT @capacitor/[email protected] results in build error.

My diff:

g di master
diff --git a/package-lock.json b/package-lock.json
index 0244284..c1164f1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2294,9 +2294,9 @@
       }
     },
     "@capacitor/ios": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-1.1.1.tgz",
-      "integrity": "sha512-6JCNWDY7E+Tt9mkzflwlK9tHl2qcPUgazZC0/aBte9lBEDpmzGPbTlHoiYeKTIqfhQeU7Qk8g6QabCx6vNzJpQ=="
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-1.2.0.tgz",
+      "integrity": "sha512-LPe1Abix3caFX25zsRIUOWHGfCQuCoGo4pWWg78AD/1pjILNd3+uzD29pMvPwC1NsgwnZrm+nnYcUl1KSRLVpQ=="
     },
     "@ionic-native/core": {
       "version": "5.13.0",
diff --git a/package.json b/package.json
index a7c606c..7e653dc 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
     "@angular/router": "~8.1.2",
     "@capacitor/android": "^1.1.1",
     "@capacitor/core": "1.1.1",
-    "@capacitor/ios": "^1.1.1",
+    "@capacitor/ios": "^1.2.0",
     "@ionic-native/core": "^5.13.0",
     "@ionic-native/splash-screen": "^5.13.0",
     "@ionic-native/status-bar": "^5.13.0",

Resulting error:

[05:45:06]: $ set -o pipefail && xcodebuild -workspace ios/App/App.xcworkspace -scheme App -destination 'generic/platform=iOS' -archivePath /Users/distiller/Library/Developer/Xcode/Archives/2019-09-06/App\ 2019-09-06\ 05.45.06.xcarchive clean archive | tee /Users/distiller/project/output/buildlogs/gym/App-App.log | xcpretty

# normal/etc...

[05:45:42]: ▸ Compiling DefaultPlugins.m
[05:45:42]: ▸ Compiling Capacitor_vers.c
[05:45:42]: ▸ Compiling Capacitor-dummy.m
[05:45:42]: ▸ Compiling CAPPluginMethod.m
[05:45:42]: ▸ Compiling CAPPluginCall.m
[05:45:42]: ▸ Compiling CAPPlugin.m
[05:45:42]: ▸ Linking Capacitor
[05:45:42]: ▸ ❌  Undefined symbols for architecture arm64
[05:45:42]: ▸ > Symbol: _OBJC_CLASS_$_CAPPermissionsPlugin
[05:45:42]: ▸ > Referenced from: l_OBJC_$_CATEGORY_CAPPermissionsPlugin_$_CAPPluginCategory in DefaultPlugins.o
[05:45:42]: ▸ ❌  ld: symbol(s) not found for architecture arm64
[05:45:42]: ▸ ❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)
[05:45:42]: ▸ ** ARCHIVE FAILED **
[05:45:42]: ▸ The following build commands failed:
[05:45:42]: ▸     Ld /Users/distiller/Library/Developer/Xcode/DerivedData/App-hjcpfurhuavuxahacyugyzwwmrzx/Build/Intermediates.noindex/ArchiveIntermediates/App/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Capacitor.framework/Capacitor normal arm64
[05:45:42]: ▸ (1 failure)

It seems if I also (manually) update @capacitor/core to 1.2.0 then the issue goes away.

Why isn't there a dependency in @capacitor/[email protected] that @capacitor/[email protected] is required?

bug dependencies

Most helpful comment

Ok, just resolved my problems by executing npx cap sync on the project folder, then cleaning build folder on XCode (Product > Clean Build Folder) and rebuilding.

All 9 comments

@bipoza - it's not clear to me how your comment is relevant as it is clearly an xcode build failure. Nothing to do with gradle.

Sorry for yesterday's bad response. Ionic just posted a major change in the UiWebView API to correct future errors.
https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/

I may not be giving you the answer you want, but it seems interesting.

In case it's not clear: My concern is not the specific error.

My concern is that it appears like dependencies aren't being managed correctly by the capacitor packages.

I'm having the same problem. Cannot build with @capacitor/[email protected] and @capacitor/[email protected].

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_CAPPermissionsPlugin", referenced from:
      l_OBJC_$_CATEGORY_CAPPermissionsPlugin_$_CAPPluginCategory in DefaultPlugins.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ok, just resolved my problems by executing npx cap sync on the project folder, then cleaning build folder on XCode (Product > Clean Build Folder) and rebuilding.

In latest release I've put a peerDependency to @capacitor/core. But looks like the release script didn't update to latest, so it's not correctly solved yet.
Since all packages are released as the same time is hard to make them depend on the others as the versions don't exist yet.

@parnanzio thanks a lot, it worked on Xcode Version 11.2.1 also

still not working. pod 1.6.0 xcode 11.3.1

The platform packages now have a peer dependency to core matching their version, so npm should warn when versions don't match.
Also we have updated the cli to warn if core version doesn't match the platform version on update/sync command.
Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TayKara picture TayKara  ·  3Comments

alexcroox picture alexcroox  ·  3Comments

json-derulo picture json-derulo  ·  3Comments

MatanYadaev picture MatanYadaev  ·  3Comments

peterpeterparker picture peterpeterparker  ·  3Comments