Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to verify instance (org.apache.poi.ss.formula.ptg.EqualPtg) is a singleton. #57

Closed
Sanunez opened this issue May 23, 2019 · 1 comment

Comments

@Sanunez
Copy link

Sanunez commented May 23, 2019

I get the following error when trying to proguard my code with the suggested rules

2019-05-23 12:01:48.138 24237-24299/omegaonedevelopers.client.omegamaps E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
    Process: omegaonedevelopers.client.omegamaps, PID: 24237
    java.lang.RuntimeException: An error occurred while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:354)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
        at java.util.concurrent.FutureTask.run(FutureTask.java:271)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.lang.ExceptionInInitializerError
        at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(Unknown Source:0)
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(SourceFile:63)
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(SourceFile:12)
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(SourceFile:2)
        at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(SourceFile:2)
        at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(SourceFile:5)
        at omegaonedevelopers.client.omegamaps.MainActivity.a(SourceFile:53)
        at omegaonedevelopers.client.omegamaps.MainActivity.b(SourceFile:2)
        at omegaonedevelopers.client.omegamaps.MainActivity$a.doInBackground(SourceFile:4)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
     Caused by: java.lang.RuntimeException: Failed to verify instance (org.apache.poi.ss.formula.ptg.EqualPtg) is a singleton.
        at org.apache.poi.ss.formula.OperationEvaluatorFactory.put(SourceFile:4)
        at org.apache.poi.ss.formula.OperationEvaluatorFactory.initialiseInstancesMap(SourceFile:2)
        at org.apache.poi.ss.formula.OperationEvaluatorFactory.<clinit>(SourceFile:1)
        at org.apache.poi.ss.formula.OperationEvaluatorFactory.evaluate(Unknown Source:0) 
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(SourceFile:63) 
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(SourceFile:12) 
        at org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(SourceFile:2) 
        at org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(SourceFile:2) 
        at org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluate(SourceFile:5) 
        at omegaonedevelopers.client.omegamaps.MainActivity.a(SourceFile:53) 
        at omegaonedevelopers.client.omegamaps.MainActivity.b(SourceFile:2) 
        at omegaonedevelopers.client.omegamaps.MainActivity$a.doInBackground(SourceFile:4) 
        at android.os.AsyncTask$2.call(AsyncTask.java:333) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 

When running to get this code

private String getCellValue(FormulaEvaluator evaluator, Cell cell){
        String cellString = "";
        try {
            CellValue cellValue = evaluator.evaluate(cell);
            if(cellValue != null){
                switch (cellValue.getCellType()) {
                    case Cell.CELL_TYPE_BOOLEAN:
                        cellString = Boolean.toString(cellValue.getBooleanValue());
                        break;
                    case Cell.CELL_TYPE_NUMERIC:
                        cellString = Double.toString(cellValue.getNumberValue());
                        break;
                    case Cell.CELL_TYPE_STRING:
                        cellString = cellValue.getStringValue();
                        break;
                }
            }
        } catch (Exception e) {
            Log.e(TAG, e.getMessage());
        }
        return cellString;
    }
@centic9
Copy link
Owner

centic9 commented Aug 2, 2019

Sorry, I have only very little knowledge about proguard for Android, so I cannot help much here, except asking you to try to exclude this class from proguard.

Probably some other place for asking questions like stackoverflow may be able to provide some useful answers.

@centic9 centic9 closed this as completed Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants