disusered / cordova-safe

File encryption for Cordova.
MIT License
35 stars 22 forks source link

FileEncryption plugin is not installed. #25

Open hydrococcous opened 6 years ago

hydrococcous commented 6 years ago

i try to install this plugin, but ionic say: "FileEncryption plugin is not installed." But I installed with:

$ ionic cordova plugin add cordova-safe
$ npm install --save @ionic-native/file-encryption

And I use it as following:

import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { FileEncryption } from '@ionic-native/file-encryption';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {

  constructor(public navCtrl: NavController,
              private fileEncryption: FileEncryption,
              public platform: Platform) {

              this.platform.ready().then(() => {

                console.log('Platform ready!!!');

                this.fileEncryption.decrypt('assets/json/secret.json', 'secretKey');
                this.fileEncryption.encrypt('assets/json/secret.json', 'secretKey');

              });

  }

}

Native: tried calling FileEncryption.decrypt, but the FileEncryption plugin is not installed. Install the FileEncryption plugin: 'ionic cordova plugin add cordova-safe'

This is my Configuration:

cli packages: (C:\Users\username.npm-packages\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v6.9.4
npm  : 5.6.0
OS   : Windows 10

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro
soicem commented 6 years ago

I have a same issue with you. and after running my app with that error messages, I can't build it anymore

clickervinod commented 6 years ago

hi,

change this line in plugins/cordova-safe/src/android/conceal.gradle

repositories {
  mavenCentral()
}

dependencies {
// change version 1.0.0 ro 1.1.3
  compile('com.facebook.conceal:conceal:1.1.3@aar') {
    transitive = true
  }
}

android {
  packagingOptions {
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
  }
}
SanthoshPixmonks commented 5 years ago

@ClickerVinod I have tried your solution app is building but when using the plugin inside the application it is throwing Native: plugin is not installed error.