Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

package com.facebook.android.crypto.keychain does not exist #22

Open
thiraj opened this issue Dec 10, 2017 · 9 comments
Open

package com.facebook.android.crypto.keychain does not exist #22

thiraj opened this issue Dec 10, 2017 · 9 comments

Comments

@thiraj
Copy link

thiraj commented Dec 10, 2017

After install plugin Ionic 3 app cannot run. it getting error

Error: cmd: Command failed with exit code 1 Error output:
G:\Android\TestProject\platforms\android\src\com\disusered\Safe.java:26: error: package com.facebook.android.crypto.keychain does not exist
import com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain;
^
G:\Android\TestProject\platforms\android\src\com\disusered\Safe.java:120: error: cannot find symbol
CRYPTO = new Crypto(new SharedPrefsBackedKeyChain(CONTEXT), new SystemNativeCryptoLibrary());
^
symbol: class SharedPrefsBackedKeyChain
location: class Safe
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: G:\Android\TestProject\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

@juthawong
Copy link

Hi Thiraj , I fork this project and found that this error from Original Facebook Conceal Gradle.

After Update The Version Number , The Code is back working again!

👍 👍 🏆

@govind38
Copy link

Hi juthawong ,

Can you please mention which version in which file did u change?

@abhishekSDEI
Copy link

Hi @juthawong
Can you please mention in which file you made the change. Also what did you change?

@juthawong
Copy link

Hello @abhishekSDEI , @govind38 .

Sorry , I just open my Github.

Just update conceal.gradle file to 1.1.2 or 1.1.3.

Here is the references : https://github.com/juthawong/cordova-safe/blob/master/src/android/conceal.gradle

I tested it on Cordova 6.4.0 and it works!.

Thanks.

P.s. I also submitting pull request for the awesome project owner for review because he is a creator and he knows best.

@abhishekSDEI
Copy link

Hello @juthawong

Thanks for the quick reply.

Unfortunately it didn't fix my issue. I updated the conceal.gradle file to both 1.1.2 & 1.1.3 but neither fixed my issue. :(

@dirk-theshiftleft
Copy link

In case it helps, I got mine working in ionic 3 after downgrading cordova

npm uninstall cordova
npm install -g [email protected]

@thiraj
Copy link
Author

thiraj commented Feb 26, 2018

@juthawong

Thanks for reply. But I had to release app without that feature. Anyway now I can use in future.

@BDominik
Copy link

I'm using cordova 7.1.0 and still get this error:
C:\www\cordova-plugins\platforms\android\app\src\main\java\com\disusered\Safe.java:26: error: package com.facebook.android.crypto.keychain does not exist
import com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain;

Any other sollution?

@BDominik
Copy link

I already found this solution somewhere else but then it's didn't worked.
Ionic Info

Ionic:

ionic (Ionic CLI) : 4.0.5 (C:\Users\bdomi\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.11

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : not available

System:

Android SDK Tools : 26.1.1
NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
npm : 6.3.0
OS : Windows 10

So now what I did is the folowing.
In the platforms/android/cordova-safe/starter-conceal.gradle change this
compile('com.facebook.conceal:conceal:1.0.0@aar')
to this
compile('com.facebook.conceal:conceal:2.0.1@aar')
I hope it will work for you too.

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

No branches or pull requests

6 participants