android - app:dexDebug - UNEXPECTED TOP-LEVEL EXCEPTION - on AsyncTask -


oh how hate error.

i'm getting dreaded dexdebug error, time around have no idea how fix it.

the exact error is:

 information:gradle tasks [:app:assembledebug] :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72221library up-to-date :app:preparecomandroidsupportsupportv42300library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets up-to-date :app:generatedebugresvalues up-to-date :app:generatedebugresources up-to-date :app:mergedebugresources up-to-date :app:processdebugmanifest up-to-date :app:processdebugresources up-to-date :app:generatedebugsources up-to-date :app:processdebugjavares up-to-date :app:compiledebugjavawithjavac note: input files use or override deprecated api. note: recompile -xlint:deprecation details. :app:compiledebugndk up-to-date :app:compiledebugsources :app:predexdebug :app:dexdebug unexpected top-level exception: com.android.dex.util.exceptionwithcontext     @ com.android.dex.util.exceptionwithcontext.withcontext(exceptionwithcontext.java:45)     @ com.android.dx.dex.cf.cftranslator.processmethods(cftranslator.java:369)     @ com.android.dx.dex.cf.cftranslator.translate0(cftranslator.java:137)     @ com.android.dx.dex.cf.cftranslator.translate(cftranslator.java:93)     @ com.android.dx.command.dexer.main.processclass(main.java:729)     @ com.android.dx.command.dexer.main.processfilebytes(main.java:673)     @ com.android.dx.command.dexer.main.access$300(main.java:83)     @ com.android.dx.command.dexer.main$1.processfilebytes(main.java:602)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:170)     @ com.android.dx.cf.direct.classpathopener.processdirectory(classpathopener.java:229)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:158)     @ com.android.dx.cf.direct.classpathopener.processdirectory(classpathopener.java:229)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:158)     @ com.android.dx.cf.direct.classpathopener.processdirectory(classpathopener.java:229)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:158)     @ com.android.dx.cf.direct.classpathopener.processdirectory(classpathopener.java:229)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:158)     @ com.android.dx.cf.direct.classpathopener.processdirectory(classpathopener.java:229)     @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:158)     @ com.android.dx.cf.direct.classpathopener.process(classpathopener.java:144)     @ com.android.dx.command.dexer.main.processone(main.java:632)     @ com.android.dx.command.dexer.main.processallfiles(main.java:510)     @ com.android.dx.command.dexer.main.runmonodex(main.java:280)     @ com.android.dx.command.dexer.main.run(main.java:246)     @ com.android.dx.command.dexer.main.main(main.java:215)     @ com.android.dx.command.main.main(main.java:106) caused by: java.lang.nullpointerexception     @ com.android.dx.cf.code.concretemethod.<init>(concretemethod.java:87)     @ com.android.dx.cf.code.concretemethod.<init>(concretemethod.java:75)     @ com.android.dx.dex.cf.cftranslator.processmethods(cftranslator.java:271)     ... 24 more ...while processing <init> (lcom/appzylabs/pratik/dailydeals/webfragment;)v ...while processing com/appzylabs/pratik/dailydeals/webfragment$1.class 1 error; aborting error:execution failed task ':app:dexdebug'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.7.0_71\bin\java.exe'' finished non-zero exit value 1 information:build failed information:total time: 16.398 secs information:1 error information:0 warnings information:see complete output in console 

i have 2 dependencies , clean app.gradle below:

    apply plugin: 'com.android.application'  android {     compilesdkversion 22     buildtoolsversion "22.0.1"      defaultconfig {         applicationid "com.appzylabs.pratik.dailydeals"         minsdkversion 8         targetsdkversion 22         versioncode 1         versionname "1.0"      }     buildtypes {         release {             minifyenabled true             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     compile filetree(include: ['*.jar'], dir: 'libs')     compile 'com.android.support:appcompat-v7:22.2.1'     compile 'com.android.support:support-v4:23.0.0' } 

here things have tried fix this, no avail: 1) including jar jsoup removed that. no help. 2) added multidex support (multidexenabled true) , android:name="android.support.multidex.multidexapplication" in androidmanifest.xml. nada. 3) did clean/build, , cleared caches , restarted android studio. again, nothing.

note happening when trying run asynctask. if comment out line compiles charm:

new myloadwebview().execute(""); 

what issue? can please?

ok, based on android dex issue: nested class + final boolean : com.android.dex.util.exceptionwithcontext, figured there wrong inner class creating async task. did changed class declaration of asynctask private public:

private class myloadwebview extends asynctask<string, void, void> { .. 

to

public class myinnerloadwebview extends asynctask<string, void, void> { .. 

and worked!!!!

i still don't know why is, seems serious bug. comments?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -