mostafa-mansour1/previewAnyFile

Build fail IOS with version 0.2.2

maartenheideman opened this issue · 12 comments

My app fails to build after updating previewAnyFile from 0.1.6 to 0.2.2. Any idea what is could be?

Undefined symbol: _kUTTagClassMIMEType
Undefined symbol: _kUTTagClassFilenameExtension
Undefined symbol: _UTTypeCreatePreferredIdentifierForTag
Undefined symbol: _UTTypeCopyPreferredTagWithClass
Undefined symbols for architecture arm64:
  "_kUTTagClassMIMEType", referenced from:
      CordovaPlugins.PreviewAnyFile.previewPath(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
      CordovaPlugins.PreviewAnyFile.previewBase64(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
  "_kUTTagClassFilenameExtension", referenced from:
      CordovaPlugins.PreviewAnyFile.previewPath(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
      CordovaPlugins.PreviewAnyFile.previewBase64(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
  "_UTTypeCreatePreferredIdentifierForTag", referenced from:
      CordovaPlugins.PreviewAnyFile.previewPath(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
      CordovaPlugins.PreviewAnyFile.previewBase64(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
  "_UTTypeCopyPreferredTagWithClass", referenced from:
      CordovaPlugins.PreviewAnyFile.previewPath(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
      CordovaPlugins.PreviewAnyFile.previewBase64(_command: __C.CDVInvokedUrlCommand) -> () in PreviewAnyFile.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I think something cached in your system

can you try this solution?

https://stackoverflow.com/a/42063043/1002042

Press "Cmmand+Shift+K" to clean up, and quit Xcode.
delete the cache Run "rm -rf ~/Library/Developer/Xcode/DerivedData" in terminal
open the project and re-build it

That's not solving the issue. Same errors appear on building. Downgrading to 0.1.7 fix the issue but I'll need to view base64. Hope there is a fix.

kindly send the output of

ionic info

can u link the CoreServices.framework to your project?

image

image

kindly send the output of

ionic info
Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.2.3
   @angular-devkit/build-angular : 0.1100.2
   @angular-devkit/schematics    : 9.1.11
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.0

Capacitor:

   capacitor (Capacitor CLI) : 2.4.2
   @capacitor/core           : 2.4.2

System:

   NodeJS : v10.15.3 (/usr/local/bin/node)
   npm    : 6.14.4
   OS     : macOS

package.json

{
  "name": "myapp",
  "version": "2.0.2",
  "author": "me",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "copy": "npx cap copy",
    "open": "npx cap open ios"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~10.0.0",
    "@angular/core": "~10.0.0",
    "@angular/forms": "~10.0.0",
    "@angular/platform-browser": "~10.0.0",
    "@angular/platform-browser-dynamic": "~10.0.0",
    "@angular/pwa": "0.901.11",
    "@angular/router": "~10.0.0",
    "@angular/service-worker": "8.2.14",
    "@capacitor/android": "^2.4.2",
    "@capacitor/cli": "2.4.2",
    "@capacitor/core": "2.4.2",
    "@capacitor/ios": "^2.4.1",
    "@ionic-native/app-version": "5.27.0",
    "@ionic-native/background-mode": "5.28.0",
    "@ionic-native/barcode-scanner": "^5.31.1",
    "@ionic-native/call-number": "5.27.0",
    "@ionic-native/core": "5.27.0",
    "@ionic-native/crop": "^5.31.1",
    "@ionic-native/device": "5.27.0",
    "@ionic-native/dialogs": "5.27.0",
    "@ionic-native/insomnia": "5.27.0",
    "@ionic-native/keyboard": "5.27.0",
    "@ionic-native/launch-navigator": "5.27.0",
    "@ionic-native/pin-check": "5.28.0",
    "@ionic-native/preview-any-file": "5.28.0",
    "@ionic-native/push": "5.27.0",
    "@ionic-native/splash-screen": "5.27.0",
    "@ionic-native/status-bar": "5.27.0",
    "@ionic-native/streaming-media": "5.27.0",
    "@ionic/angular": "5.2.3",
    "@ionic/storage": "^2.3.1",
    "@ng-bootstrap/ng-bootstrap": "5.3.1",
    "@ngx-formly/core": "5.9.1",
    "@ngx-formly/ionic": "5.9.1",
    "@ngx-formly/schematics": "5.9.1",
    "call-number": "1.0.1",
    "cordova-plugin-actionsheet": "2.3.3",
    "cordova-plugin-androidx": "^3.0.0",
    "cordova-plugin-androidx-adapter": "^1.1.3",
    "cordova-plugin-app-version": "0.1.9",
    "cordova-plugin-background-mode": "0.7.3",
    "cordova-plugin-crop": "^0.4.0",
    "cordova-plugin-device": "2.0.3",
    "cordova-plugin-dialogs": "2.0.2",
    "cordova-plugin-insomnia": "4.3.0",
    "cordova-plugin-pincheck": "0.0.6",
    "cordova-plugin-preview-any-file": "^0.2.2",
    "cordova-plugin-streaming-media": "2.3.0",
    "core-js": "2.5.4",
    "ionic-cache": "5.2.0",
    "ionic2-calendar": "0.6.6",
    "moment": "2.27.0",
    "ng2-date-picker": "10.0.1",
    "phonegap-plugin-barcodescanner": "^8.1.0",
    "rxjs": "6.5.5",
    "tslib": "^2.0.0",
    "uk.co.workingedge.phonegap.plugin.launchnavigator": "5.0.4",
    "zone.js": "~0.10.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1100.2",
    "@angular/cli": "~10.0.5",
    "@angular/compiler": "~10.0.0",
    "@angular/compiler-cli": "~10.0.0",
    "@angular/language-service": "~10.0.0",
    "@ionic/angular-toolkit": "2.3.0",
    "@types/jasmine": "3.3.8",
    "@types/jasminewd2": "2.0.3",
    "@types/node": "^12.12.58",
    "codelyzer": "5.0.0",
    "jasmine-core": "3.5.0",
    "jasmine-spec-reporter": "5.0.0",
    "karma": "5.0.0",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage-istanbul-reporter": "3.0.2",
    "karma-jasmine": "3.3.0",
    "karma-jasmine-html-reporter": "1.5.4",
    "protractor": "7.0.0",
    "ts-node": "8.3.0",
    "tslint": "6.1.0",
    "typescript": "3.9.5"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {}
  }
}

can u link the CoreServices.framework to your project? this doesn't fix the problem.

try link the framework here also

image

if it not working, kindly send in private your ios folder mostafa@outlook.kr

thanks for sharing the ios folder with me

I found the solution

just apply the following steps, and it will build successfully

image

Thanx for the reply! Your suggestion works and fixes the issue!

Maybe for a next release.. every time on running npx cap sync you have to re add 'CoreServices.framework' to the Pods, shouldn't that go automatically?

i will check how to do that, and will update the plugin

kindly check the plugin in this branch
if it works I will merge it to master

https://github.com/mostafa-mansour1/previewAnyFile.git#fix_ios_framework

I have no idea how to add Cordova plugin from branches in the capacitor,
if u cannot add from a branch, you can download the branch and add it manually

waiting for your confirmation

I'll tried and build succeeded even after npx cap sync so great work!