java-json-tools / json-schema-validator

A JSON Schema validation implementation in pure Java, which aims for correctness and performance, in that order
http://json-schema-validator.herokuapp.com/
Other
1.63k stars 400 forks source link

NoSuchFieldError on signing #398

Open GauravKamble09 opened 2 years ago

GauravKamble09 commented 2 years ago

Hello, I am using version 2.2.14 of JSON schema validator. We are using a schema file to validate. Following is the code for the same.

File tempFile; try{ InputStream inputStream = mContext.getResources().openRawResource(R.raw.schemafile); tempFile = File.createTempFile("pre", "suf"); copyFile(inputStream, new FileOutputStream(tempFile)); } catch (IOException e) { throw new RuntimeException("Can't create temp file ", e); }

JsonNode schemaNode = JsonLoader.fromFile(tempFile); JsonNode inputNode = JsonLoader.fromString(inputJSON); JsonSchemaFactory factory = JsonSchemaFactory.byDefault(); JsonSchema schema = factory.getJsonSchema(schemaNode); report = schema.validate(inputNode);

But after signing the build, I am getting following error: java.lang.NoSuchFieldError: No static field PUBLIC_ONLY of type Lmyobfuscatedapp/gj/h; in class Lmyobfuscatedapp/gj/h; or its superclasses (declaration of 'myobfuscatedapp.gj.h' appears in /data/app/blancco.sdkadoptionsampleapp-AZYRsc6ne-ND0EKSp9m7vw==/base.apk!classes2.dex) at java.lang.Class.getDeclaredAnnotation(Native Method) at java.lang.Class.getAnnotation(Class.java:2493) at com.fasterxml.jackson.databind.introspect.VisibilityChecker$Std.(Unknown Source:6) at com.fasterxml.jackson.databind.introspect.VisibilityChecker$Std.defaultInstance(Unknown Source:0) at com.fasterxml.jackson.databind.ObjectMapper.(Unknown Source:19) at com.github.fge.jackson.JacksonUtils.newMapper(Unknown Source:0) at com.github.fge.jackson.JacksonUtils.(Unknown Source:4) at com.github.fge.jackson.JacksonUtils.newMapper(Unknown Source:0) at com.github.fge.jackson.JsonNodeReader.(Unknown Source:0) at com.github.fge.jackson.JsonLoader.(Unknown Source:10) at com.github.fge.jackson.JsonLoader.fromString(Unknown Source:0) at myobfuscatedapp.gg.a.l(Unknown Source:113) at com.diagnosticssdk.communicator.f.a(Unknown Source:29) at com.diagnosticssdk.DiagnosticsSDK.b(Unknown Source:133) at com.diagnosticssdk.DiagnosticsSDK.a(Unknown Source:65) at blancco.sdkadoptionsampleapp.TestExecutionActivity.s(Unknown Source:300) at blancco.sdkadoptionsampleapp.ay.onClick(Unknown Source:22) at android.view.View.performClick(View.java:7862) at android.widget.TextView.performClick(TextView.java:15004) at android.view.View.performClickInternal(View.java:7831) at android.view.View.access$3600(View.java:879) at android.view.View$PerformClick.run(View.java:29359) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

What is needed to add in pro guard file for handling this error? This code is working fine in debug build.