Forum

Browse topics, discover Works With Legrand community!

DoorEntrySDKDemo-problem with org.spongycastle.jce.provider.BouncyCastleProvider

Dear Legrand-Support,

I am still trying to get the DoorEntrySDKDemo v3.0 running.

I use Android Studio v3.6.1 and I have installed Android SDK v28.0.3.

I am able to successfully build and run the demo app and I am also able to login in my account.

I can also see my Plant. But if I click on it I get following error:


--------- beginning of crash
03-21 09:01:12.486 11823-11823/com.legrandgroup.doorentry.sdkdemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.legrandgroup.doorentry.sdkdemo, PID: 11823
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/spongycastle/jce/provider/BouncyCastleProvider;
at com.legrandgroup.doorentry.sdk.util.VctSecurity.generateCsrRequest(VctSecurity.java:84)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:135)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:92)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.access$200(PlantAlignmentProcedure.java:36)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure$1.onRequestCompleted(PlantAlignmentProcedure.java:233)
at com.legrandgroup.doorentry.sdk.rest.RestRequestManager$RunnableTask$1.run(RestRequestManager.java:194)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.spongycastle.jce.provider.BouncyCastleProvider" on path: DexPathList[[zip file "/data/app/com.legrandgroup.doorentry.sdkdemo-1/base.apk"],nativeLibraryDirectories=[/data/app/com.legrandgroup.doorentry.sdkdemo-1/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.legrandgroup.doorentry.sdk.util.VctSecurity.generateCsrRequest(VctSecurity.java:84) 
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:135) 
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:92) 
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.access$200(PlantAlignmentProcedure.java:36) 
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure$1.onRequestCompleted(PlantAlignmentProcedure.java:233) 
at com.legrandgroup.doorentry.sdk.rest.RestRequestManager$RunnableTask$1.run(RestRequestManager.java:194) 
at android.os.Handler.handleCallback(Handler.java:739) 
at android.os.Handler.dispatchMessage(Handler.java:95) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5254) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 
Suppressed: java.lang.ClassNotFoundException: org.spongycastle.jce.provider.BouncyCastleProvider
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

It looks like that BouncyCastleProvider is not included inside the APK. I added a rule to ‘proguard-rules.pro’ and tried also to build it as debug and release.
Also an Analysis with ‘Analyze APK’ and a look at the .dex-file shows that it should be included.

Also your Forum and Google weren’t very helpful. I played around with MultiDex and ProGuard Rules but I couldn’t get to a solution.

I am pretty sure it is really easy for your dev-team to know what the problem is.

Thanks in Advance.

Best regards,
ThorsHamster

Hello,

For information, I asked the SDK dev team to investigate on it. I’m waiting for their feedback

Have a good day,

Leslie – Community Manager

I have the same error in the DoorEntrySDKDemo application.

The problem is in  the line 248 in PlantAlignmentProcedure.class and the debug raise this exception:

Process: com.legrandgroup.doorentry.sdkdemo, PID: 10222
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/spongycastle/jce/provider/BouncyCastleProvider;
at com.legrandgroup.doorentry.sdk.util.VctSecurity.generateCsrRequest(VctSecurity.java:84)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:135)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:92)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.access$200(PlantAlignmentProcedure.java:36)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure$1.onRequestCompleted(PlantAlignmentProcedure.java:233)
at com.legrandgroup.doorentry.sdk.rest.RestRequestManager$RunnableTask$1.run(RestRequestManager.java:194)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “org.spongycastle.jce.provider.BouncyCastleProvider” on path: DexPathList[[zip file “/data/app/com.legrandgroup.doorentry.sdkdemo-dvh0YVBzI92Bj9TG9nrO0w==/base.apk”],nativeLibraryDirectories=[/data/app/com.legrandgroup.doorentry.sdkdemo-dvh0YVBzI92Bj9TG9nrO0w==/lib/x86, /data/app/com.legrandgroup.doorentry.sdkdemo-dvh0YVBzI92Bj9TG9nrO0w==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.legrandgroup.doorentry.sdk.util.VctSecurity.generateCsrRequest(VctSecurity.java:84)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:135)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.setState(PlantAlignmentProcedure.java:92)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure.access$200(PlantAlignmentProcedure.java:36)
at com.legrandgroup.doorentry.sdk.procedures.PlantAlignmentProcedure$1.onRequestCompleted(PlantAlignmentProcedure.java:233)
at com.legrandgroup.doorentry.sdk.rest.RestRequestManager$RunnableTask$1.run(RestRequestManager.java:194)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

We are waiting for the fix

Best regards

 

Hello,

The Italian team in charge with the DoorEntrySDK is warned, but they won’t be able to investigate before one or two weeks

I’ll let you know as soon as I have more information

Sorry for the inconvenience and have a good day,

Leslie – Community Manager

Any update on this?

Hello,

The issue is identified and will be corrected in the next 3.1 version of the SDK. But I don’t have a launch date for the moment

Here is a temporary patch :

 

Resolution strategy:
Demo app must include spongycastle dependencies as well

AAR file does not pack inside jar dependencies which are

not already files here in build tree.

SDK Dependencies shoud be replicated in Demo app build.gradle

to allow final demo app to external developers to resolve

everything

Developers’ patch:
+++ b/demo/build.gradle
@@ -64,6 +64,10 @@ dependencies {

}

implementation ‘com.auth0.android:jwtdecode:1.1.1’

implementation ‘com.squareup.okhttp3:okhttp:3.9.1’

+    implementation ‘com.madgag.spongycastle:core:1.51.0.0’

+    implementation ‘com.madgag.spongycastle:prov:1.51.0.0’

+    implementation ‘com.madgag.spongycastle:pkix:1.51.0.0’

+    implementation ‘com.madgag.spongycastle:pg:1.51.0.0’

implementation project(path: ‘:sdk’)

}

Practically, is enough for a developer to add the above lines with the necessary dependencies (marked with +) in the build.gradle file in the ‘demo‘ folder

 

Have a good day,

Leslie – Community Manager

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Information

watch_later 4 weeks, 1 day ago
message5 replies
people4 participants