1

I have spent lot of time on googling still I don't find solution to my problem. I already tried following things 1.Downgrading Gradle version. 2.Added new jar to library. 3.Clean and rebuild of project.

Tragedy is I used same jar in other two projects and it works like charm with out any issue, I already compared with other projects but could not find root cause.

What could be wrong guys?

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.3'

    defaultConfig {
        applicationId "garuda.GarudaMpos"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        incremental true
        javaMaxHeapSize "2048M"
        jumboMode = true

    }
    lintOptions{
        checkReleaseBuilds false
        abortOnError false
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }



    android {
        useLibrary 'org.apache.http.legacy'
    }


}




dependencies {
    compile files('libs/mysql-connector-java-5.0.8-bin.jar')
    compile files('libs/zbar.jar')
    compile files('libs/ePOS-Print.jar')
    compile files('libs/printer-lib.jar')
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'com.google.android.gms:play-services-appindexing:8.4.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services-auth:8.4.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:multidex:1.0.1'
    compile files('libs/velocity-1.5.jar')

}

In below class i get verify error when i create Object of ScriptEngineVelocity(), this line p = new ScriptEngineVelocity();

package com.openbravo.pos.scripting;


    import android.util.Log;

    public class ScriptFactory {

        public static final String VELOCITY = "velocity";
        public static final String BEANSHELL = "beanshell";
        public static final String RHINO = "rhino";
        private static final String SHETTY = "shetty";

        /** Creates a new instance of ScriptFactory */
        private ScriptFactory() {
        }

        public static ScriptEngine getScriptEngine(String name) throws ScriptException {
            if (VELOCITY.equals(name)) {
                System.out.println("RRRRRRRRRRRRRRRRRRRRAAAAAAAAAAAAAAAAAHHHHHHHHHHH11");

                ScriptEngine p= null;
                try {
                    p = new ScriptEngineVelocity();
                } catch (ScriptException e) {
                    e.printStackTrace();
                    Log.d(SHETTY, "getScriptEngine: "+e);
                    p=null;
                }

                return p;
            } else if (BEANSHELL.equals(name)) {
                return new ScriptEngineBeanshell();

            } else {
                throw new ScriptException("Script engine not found: " + name);
            }
        }
    }

And my logcat

11-23 11:36:10.220 22767-22767/garuda.GarudaMpos E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   java.lang.VerifyError: com/openbravo/pos/scripting/ScriptEngineVelocity
                                                                       at com.openbravo.pos.scripting.ScriptFactory.getScriptEngine(ScriptFactory.java:25)
                                                                       at com.garuda.GarudaMpos.Bill_format_Display.printTicket(Bill_format_Display.java:482)
                                                                       at com.garuda.GarudaMpos.Bill_format_Display.PrintTicket(Bill_format_Display.java:381)
                                                                       at com.garuda.GarudaMpos.Bill_format_Display$1.onClick(Bill_format_Display.java:147)
                                                                       at android.view.View.performClick(View.java:4107)
                                                                       at android.view.View$PerformClick.run(View.java:17160)
                                                                       at android.os.Handler.handleCallback(Handler.java:615)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:92)
                                                                       at android.os.Looper.loop(Looper.java:155)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5536)
                                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                                       at java.lang.reflect.Method.invoke(Method.java:511)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1074)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:841)
                                                                       at dalvik.system.NativeStart.main(Native Method)
Payal Sorathiya
  • 756
  • 1
  • 8
  • 23
Chethan Shetty
  • 179
  • 1
  • 10

0 Answers0