Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

ExceptionInInitializerError on the last version 1.3.0 for Android #323

Closed
Pschsch opened this issue Mar 16, 2020 · 5 comments
Closed

ExceptionInInitializerError on the last version 1.3.0 for Android #323

Pschsch opened this issue Mar 16, 2020 · 5 comments

Comments

@Pschsch
Copy link

Pschsch commented Mar 16, 2020

While trying to register Tink, app crashes at KeysetHandle.generateNew(AeadKeyTemplates.AES256_GCM) Same result in another key templates.

@thaidn
Copy link
Contributor

thaidn commented Mar 21, 2020

Could you please provide the full stack trace? There's a known issue with protobuf. If you also depend on for example Firebase, there's a protobuf dependency conflict.

@simtse
Copy link
Contributor

simtse commented Apr 15, 2020

@thaidn So we're running into an exception in initializing that came up in 1.3.0 in our CI that uses Firebase Test Lab. For a while, we didn't seem to run into this stack trace. But recently, we also included https://github.com/aws/amazon-chime-sdk-android which seems to use according to their THIRD-PARTY.txt

protobuf; version 3.5.1 -- https://github.com/google/protobuf

E/TinkSecurity(19146): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.google.protobuf.Writer$FieldOrder com.google.protobuf.Writer.fieldOrder()' on a null object reference
E/TinkSecurity(19146): 	at com.google.protobuf.MessageSchema.writeTo(MessageSchema.java:2529)
E/TinkSecurity(19146): 	at com.google.protobuf.GeneratedMessageLite.writeTo(GeneratedMessageLite.java:268)
E/TinkSecurity(19146): 	at com.google.crypto.tink.KeyManagerImpl.newKeyData(KeyManagerImpl.java:121)
E/TinkSecurity(19146): 	at com.google.crypto.tink.Registry.newKeyData(Registry.java:716)
E/TinkSecurity(19146): 	at com.google.crypto.tink.KeysetManager.newKey(KeysetManager.java:231)
E/TinkSecurity(19146): 	at com.google.crypto.tink.KeysetManager.addNewKey(KeysetManager.java:91)
E/TinkSecurity(19146): 	at com.google.crypto.tink.KeysetManager.rotate(KeysetManager.java:68)
E/TinkSecurity(19146): 	at com.google.crypto.tink.integration.android.AndroidKeysetManager.readOrGenerateNewKeyset(AndroidKeysetManager.java:306)
E/TinkSecurity(19146): 	at com.google.crypto.tink.integration.android.AndroidKeysetManager.<init>(AndroidKeysetManager.java:124)
E/TinkSecurity(19146): 	at com.google.crypto.tink.integration.android.AndroidKeysetManager.<init>(AndroidKeysetManager.java:88)
E/TinkSecurity(19146): 	at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:185)
E/TinkSecurity(19146): 	at com.sample.TinkCrypto.initTink(TinkCrypto.kt:124)

@thaidn
Copy link
Contributor

thaidn commented May 8, 2020

This is a known issue. We're working on a fix. It should be available in HEAD-SNAPSHOT next week and included in 1.4.0-RC2.

@thaidn
Copy link
Contributor

thaidn commented May 9, 2020

This is fixed in HEAD-SNAPSHOT. Please try it out to see if it helps, instructions are at #357 (comment).

@thaidn
Copy link
Contributor

thaidn commented May 9, 2020

This is a dup of #301. Let's move the discussion over there.

@thaidn thaidn closed this as completed May 9, 2020
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

3 participants