Crypho / cordova-plugin-secure-storage

Secure storage plugin for Apache Cordova
MIT License
278 stars 269 forks source link

Not working on IOS 11.1 emulator #134

Closed omargon closed 6 years ago

omargon commented 7 years ago

Secure storage fails after upgrading to Xcode 9 and running IOS emulator on IOS 11.1. Anyone else experiencing this issue?

Error: {"line":59,"column":50,"sourceURL":"/plugins/cordova-plugin-secure-storage/www/securestorage.js"}

Emulator command:

ionic cordova emulate ios --target=iPhone-5s -lc

Ionic Info:

cli packages: (/Users/{user}/.nvm/versions/node/v6.11.4/lib/node_modules)

    @ionic/cli-utils  : 1.16.0
    ionic (Ionic CLI) : 3.16.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    Cordova Platforms : android 6.3.0 ios 4.5.2
    Ionic Framework   : ionic1 1.3.1

System:

    ios-deploy : 1.9.1
    ios-sim    : 6.1.2
    Node       : v6.11.4
    npm        : 3.10.10
    OS         : macOS Sierra
    Xcode      : Xcode 9.1 Build version 9B55

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro
niekheezemans commented 7 years ago

Same issue here with Ionic.

It works when I run "cordova build ios" and then run the simulator from XCode. It doesn't work when directly running "cordova run ios" or "cordova emulate ios" from the CLI with or without the parameters for livereload.

I also enabled KeyChain sharing in the XCode project

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.17.0
ionic (Ionic CLI) : 3.17.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.0.1-201711040536
Cordova Platforms  : ios 4.5.3
Ionic Framework    : ionic-angular 3.7.1

System:

Android SDK Tools : 26.0.2
ios-deploy        : 1.9.2
ios-sim           : 6.0.0
Node              : v8.4.0
npm               : 2.15.12
OS                : macOS Sierra
Xcode             : Xcode 9.1 Build version 9B55

Environment Variables:

ANDROID_HOME : /Users/******/Library/Android/sdk

Misc:

backend : pro
ggozad commented 7 years ago

Somebody will have to volunteer to fix this.

sagrawal31 commented 7 years ago

Not have any experience with iOS Native code but if you can point out to the problem then I can try & fix it.

joshterrill commented 7 years ago

@ggozad just like @sagrawal31 said, I could also try to fix it as well, if you could just point us in the right direction. I need this for an app I'm working on and would gladly give it a shot.

ggozad commented 7 years ago

@sagrawal31 @joshterrill I am not entirely sure there is something you can do. When the emulator stoped working a year ago we had to wait for a new release of xcode.

mikeg-red5hift commented 6 years ago

We got it working by setting a value for the preference:

`

`

huerlisi commented 6 years ago

@alesrosina I think you had a similar problem with a similar fix as @mikeg-red5hift documents?

alesrosina commented 6 years ago

@huerlisi I had to manualy open project in Xcode and set Keychain Sharing to ON under Capabilities in project Settings. Without this manual setting this did not work for me.

But as mentioned in the thread, this works only for buliding, not for debuging. So same problem as inital report :)

AndrWeisR commented 6 years ago

@alesrosina Keychain Sharing fix worked for me, for running in the iOS emulator. I did not have to add @mikeg-red5hift preference setting above.

niekfrontmen commented 6 years ago

Keychain sharing is a setting for allowing multiple Apps to access the same keychain.

Try adding this to your config.xml under the iOS platform:

$(AppIdentifierPrefix)your.yourbundle.id
    <edit-config file="*-Release.plist" mode="merge" target="keychain-access-groups">
        <array>
            <string>$(AppIdentifierPrefix)your.yourbundle.id</string>
        </array>
    </edit-config>
helderdiniz commented 6 years ago

Keychain Sharing on Xcode also fixed it for me but the KeychainAccessibility property did not.

l4nos commented 5 years ago

Still having a problem with this. Running emulator on 12.1

Build command

ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

`Ionic:

ionic (Ionic CLI) : 4.6.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.4.0 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9 @angular/cli : 7.3.9 @ionic/angular-toolkit : 1.5.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : ios 4.5.5 Cordova Plugins : cordova-plugin-ionic 5.3.0, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 11 other plugins)

System:

ios-deploy : 1.9.4 NodeJS : v11.1.0 (/usr/local/bin/node) npm : 6.5.0 OS : macOS Mojave Xcode : Xcode 10.1 Build version 10B61 `

I've tried adding the KeychainAccessibility and turning on Keychain Sharing but no luck!