Comments (23)
Let us check for this issue. Which samsung device exactly are you using and android version?
from hawk.
samsung GT-S5282 - 4.1.2
samsung GT-I8190 - 4.1.2
samsung GT-S5300 - 2.3.6
from hawk.
And samsung GT-I9100G - 4.1.2
Not always happen though but enough to kill my app :(
from hawk.
Same problem in my app:
Here is the stacktrace.
java.lang.RuntimeException: Unable to create application MeteoApp: java.lang.RuntimeException: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4233)
at android.app.ActivityThread.access$1300(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4827)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.RuntimeException: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
at com.orhanobut.hawk.AesEncryption.generateSecretKey(AesEncryption.java:84)
at com.orhanobut.hawk.AesEncryption.<init>(AesEncryption.java:25)
at com.orhanobut.hawk.Hawk.init(Hawk.java:68)
at com.orhanobut.hawk.Hawk.init(Hawk.java:54)
at MeteoApp.onCreate(MeteoApp.java:57)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4230)
at android.app.ActivityThread.access$1300(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4827)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151)
at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:108)
at com.orhanobut.hawk.AesCbcWithIntegrity.generateKeyFromPassword(AesCbcWithIntegrity.java:159)
at com.orhanobut.hawk.AesCbcWithIntegrity.generateKeyFromPassword(AesCbcWithIntegrity.java:185)
at com.orhanobut.hawk.AesEncryption.generateSecretKey(AesEncryption.java:82)
at com.orhanobut.hawk.AesEncryption.<init>(AesEncryption.java:25)
at com.orhanobut.hawk.Hawk.init(Hawk.java:68)
at com.orhanobut.hawk.Hawk.init(Hawk.java:54)
at MeteoApp.onCreate(MeteoApp.java:57)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4230)
at android.app.ActivityThread.access$1300(ActivityThread.java:137)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4827)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(NativeStart.java)
It happens on these devices :
This is a great library but it cannot be used on a production app used by a lot of people. The crash rate increase really quickly with that crash.
from hawk.
I started working on this issue, apparently some devices don't have this algorithm. I think today I'll create a new version with the fix
from hawk.
Thanks a lot ! If you need more info, I will be glad to help you
from hawk.
i have same problem too, thanks a lot. We are waiting for new build :)
from hawk.
Soon, there will be a new release, I'll update this post for the snapshot version, if it works we can release it. Thanks for the feedback really.
from hawk.
@aligurelli @Christophe668 @csechuan @sakirk I uploaded a new snapshot version with a fallback fix, could you try with this please? I don't have these devices and cannot test properly unfortunately, I just did some mockup.
snapshot version is
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
compile 'com.orhanobut:hawk:1.7-SNAPSHOT'
}
If everything works properly, I'll put a new release.
from hawk.
Thx. Will test it out. You replace encryption with conceal?
from hawk.
@csechuan no, I didn't use conceal, I just added a fallback to another key generation. I also updated the snapshot version with a new quick fix. Please try below.
repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/"} } dependencies { compile 'com.orhanobut:hawk:1.9-SNAPSHOT' }
from hawk.
Thx @orhanobut. Unfortunately I don't have a device affected by this issue so if I release this update it would be launched on a large set of user. Do you think it is stable enough to be released on a production app with a large set of user?
from hawk.
Best would be to wait for the release version. I also dont have these devices but gonna check this at work. This should fix this issue permanently but still need a good test.
I will keep to update this post. It would be great if someone check this version as well :(
from hawk.
So far so good.
from hawk.
@csechuan Do you have this problem anymore so far? That would be great feedback if you have tried and test it in a device that was affected this issue, Thanks
from hawk.
Has a little problem.
Caused by java.lang.NullPointerException
com.orhanobut.hawk.Hawk.encode (Hawk.java:167)
com.orhanobut.hawk.Hawk.put (Hawk.java:131)
from hawk.
I think the secretkeyfactory problem is solved, today I'll release a new build including this NPE.
from hawk.
Wait. Not yet.
When I release my app, it cant start hawk at all.
E/AndroidRuntime﹕ FATAL EXCEPTION: pool-2-thread-1
java.lang.NullPointerException
at io.abc.app.g.d.a(ELog.java:12)
at io.abc.app.g.d.a(ELog.java:20)
at io.abc.app.Hello$1.a(Hello.java:45)
at com.e.a.m$1.run(Hawk.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)
from hawk.
Can you try without proguard? and can you also tell me which android version? you may need to add some config in the proguard. I tested in a few devices, had no problem at all. Can you also tell me how do you init hawk?
from hawk.
@csechuan I think this issue is related to something, can we move this issue to another thread please? While creating issue, could you also show me the exception without proguard if possible and also the value might be null?
from hawk.
Ok. I found out the problem is with Gson itself. Gson cant serialize / deserialize enums after pro-guarded, so have to make exceptions on those enum thingy.
I am using ver 1.8, so far no problem with NPE. Thanks for solving this. I think we can close this.
from hawk.
That's great news. I'll close this issue. @csechuan thanks for testing.
from hawk.
Thank you @orhanobut for this fix and @csechuan for testing !
from hawk.
Related Issues (20)
- why not use apply but commit?
- Is there a way to setup namespace of the keys? HOT 1
- java.lang.SecurityException: MODE_WORLD_READABLE no longer supported
- Deserializing long as double
- error after changing setEncryption
- multiprocess
- can't find version 2.1.0 HOT 1
- Hawk isn't a 64-bit compliant library HOT 3
- Hawk V2.0.1, illegal type variable reference HOT 4
- The code base at tag (v.2.0.1) doesn't match with the corresponding gradle dependency
- What is the maximum value of stored data HOT 1
- Can you reload Hawk after init?
- Is this project dead? HOT 1
- Hawk getting error while debuggind HOT 1
- Hawk.put and Hawk.get issue
- DefaultHawkFacade.java line 98
- Classifier 'Hawk' does not have a companion object, and thus must be initialized here
- can't get data when overriding apps HOT 2
- ANR problem when init Hawk HOT 1
- Hawk.count() shows it has items but when use hawl.get(key, type) it gives only last or zero items
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hawk.