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

XCode build fails: Redefinition of enumerator 'SYNTAX_ERR #315

Open
3 tasks done
ryaa opened this issue May 14, 2019 · 4 comments
Open
3 tasks done

XCode build fails: Redefinition of enumerator 'SYNTAX_ERR #315

ryaa opened this issue May 14, 2019 · 4 comments

Comments

@ryaa
Copy link

ryaa commented May 14, 2019

Bug Report

XCode build fails: Redefinition of enumerator 'SYNTAX_ERR

Problem

The error started to appear when I added the below cordova plugins to the project where cordova-sqlite-storage plugin already existed:

  • cordova-plugin-file
  • cordova-plugin-qrscanner

What is expected to happen?

Build should not break.

What does actually happen?

Xcode build fails

Information

The cordova-sqlite-storage plugin has WebSQLError enum with SYNTAX_ERR = 5 and cordova-plugin-file plugin has CDVFileError enum with SYNTAX_ERR = 8. It seems to be the problem with the same name for these enums.

Command or Code

N/A

Environment, Platform, Device

See ionic info output

Ionic:

   ionic (Ionic CLI)             : 4.10.3 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.3

Capacitor:

   capacitor (Capacitor CLI) : 1.0.0-beta.24
   @capacitor/core           : 1.0.0-beta.24

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   Android SDK Tools : 26.1.1 (/Users/alexryltsov/Library/Android/sdk/)
   NodeJS            : v10.14.2 (/Users/alexryltsov/.nvm/versions/node/v10.14.2/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001

Version information

See above

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@janpio
Copy link
Member

janpio commented Jun 7, 2019

ping @brodybits

@brodycj
Copy link

brodycj commented Jun 7, 2019

Linking to storesafe/cordova-sqlite-storage#868, which is marked as a bug. I would like to resolve this problem on the cordova-sqlite-storage side. (I will probably need a few weeks to look into this one.)

The SYNTAX_ERR enumerator seems to have been defined on both plugins for several years. So I find it pretty strange that this problem would suddenly appear after multiple years. I wonder if it has anything to do with an Xcode update or any other framework updates?

@janpio
Copy link
Member

janpio commented Jun 7, 2019

enum CDVFileError {
NO_ERROR = 0,
NOT_FOUND_ERR = 1,
SECURITY_ERR = 2,
ABORT_ERR = 3,
NOT_READABLE_ERR = 4,
ENCODING_ERR = 5,
NO_MODIFICATION_ALLOWED_ERR = 6,
INVALID_STATE_ERR = 7,
SYNTAX_ERR = 8,
INVALID_MODIFICATION_ERR = 9,
QUOTA_EXCEEDED_ERR = 10,
TYPE_MISMATCH_ERR = 11,
PATH_EXISTS_ERR = 12
};

I don't even know why this is clashing with yours...

@jammind
Copy link

jammind commented Feb 25, 2020

I solved it by simply removing and adding the plugin again.

Some plugins, e.g. file-transfer and zip, will cause this problem. After installing those plugins, removing file plugin with
cordova plugin rm cordova-plugin-file --force and then add it with cordova plugin add cordova-plugin-file will fix the problem.

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

No branches or pull requests

4 participants