nativescript-app-encryption icon indicating copy to clipboard operation
nativescript-app-encryption copied to clipboard

com.tns.app_protection does not exist

Open priyangamani opened this issue 8 years ago • 3 comments

D:\Sample\platforms\android\src\main\java\com\tns\RuntimeHe lper.java:57: error: package com.tns.app_protection does not exist com.tns.app_protection.AppProtection.setKey("qyUMQZhu43KByppjVJFJyRxVG+PZaRAHId2 +mczHiwo="); ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error :compileF0F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16ReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':compileF0F1F2F3F4F5F6F7F8F9F10F11F12F13F14F15F16Rele aseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

priyangamani avatar Jul 05 '17 01:07 priyangamani

Use 0.3.0. It works. I tested it right now because I'm unable to get Webpack working. It breaks my code and I did everything possible I found. My vote to keep this project open.

ju4nj3 avatar Jul 12 '17 23:07 ju4nj3

second that vote, this is better than webpack and uglify

zenz avatar Aug 14 '17 12:08 zenz

So this is the temp solution for this plugin, and this plugin has been deprecated but it's very useful and better than uglifyjs in webpack in personal opinion. It works for me.

after tns plugin install nativescript-app-encryption, navigate to node_modules/nativescript-app-encryption/hooks path. modify the file after-prepare.js comment out this part

// The hook is used only on iOS 
//if (hookArgs.platform != 'ios') { 
    //return; 
//}

do the tns prepare android create a folder named app_protection under platform/android/src/main/java/com/tns. create and edit a file named AppProtection.java copy and paste the code from https://github.com/NativeScript/nativescript-app-encryption/blob/master/native-src/android/app/src/main/java/com/tns/app_protection/AppProtection.java save and compile your code. That's it.

zenz avatar Aug 15 '17 02:08 zenz