Dex2Oat build error

I did demo application for test MOE, but it is not working.

Pending exception java.lang.NoClassDefFoundError:$GetCheckedTypeValidatorHolder$ClassValueValidator$1
(Throwable with empty stack trace)Dumping all threads without appropriate locks held: thread list lock
All threads:
"main" prio=5 tid=1 Runnable (still starting up)
  | group="" sCount=0 dsCount=0 obj=0x0 self=0x7faa3a801000
  | sysTid=256719 nice=-1 cgrp=default sched=1/31 handle=0x7fffb157b3c0
  | state=? schedstat=( 0 0 0 ) utm=0 stm=0 core=0 HZ=100
  | stack=0x7fff5a453000-0x7fff5a45b000 stackSize=8MB
  | held mutexes= "abort lock" "mutator lock"(shared held)
  (no managed stack frames)

Full error log and sources in archive. (108.6 KB)

We will take a look at your test project.

If you remove the -keep class ** from the proguard.cfg, then the project will build and run.

How can this be understood without reference to the forum?

1 Like

I am tested your decision - it is not working.
If I remove -keep class ** , then will be mainProGuard build error.
When I typed -keep class**, then I will have error like as in this topic
I testing moe 1.3.12 and 1.4.0 versions

Ok, retested and found the cause :slight_smile: We renamed the proguard.cfg to another name in our test and forgot to mention it in our answer. Sorry about that.

You were using proguard.cfg as filename. If the gradle plugin finds this file, then it will replace the whole internal Gradle configuration with it, even if you specify it as append in the build.gradle.

If you specify proguard.append.cfg, then it will be automatically appended, no need to specify it in the build.gradle.

So the solution is to remove the -keep class **, remove the appendCfgFile setting in build.gradle and rename your file to proguard.append.cfg. (or keep the appendCfgFile, but use a different filename - I tested with proguard-other.cfg)

The special behavior of proguard.cfg is documented here:

I opened an issue on GH, to add this special corner case to the documentation / Gradle plugin should throw an error in this case:

Thanks for the report.

Best Regards,

It was helped for the test project.