Skip to content

NoSuchFieldError on signing #398

@GauravKamble09

Description

@GauravKamble09

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @GauravKamble09

        Issue actions

          NoSuchFieldError on signing · Issue #398 · java-json-tools/json-schema-validator