问题
I am implementing RazorPay android checkout. I followed Razorpay Android sdk doc. When running app gradle build fails with this error. I have posted that on RazorPay also.
Exception in thread "main" java.lang.NullPointerException: Couldn't find outer class com/razorpay/Y_$B$ of com/razorpay/Y_$B$$5
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:1079)
at com.google.devtools.build.android.desugar.ClassVsInterface.isOuterInterface(ClassVsInterface.java:56)
at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitOuterClass(InterfaceDesugaring.java:246)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:638)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
If some developer faced this issue, please tell me a solution.
I have no code to show, its only picked from above razorpay doc.
回答1:
I found solution after searching a lot.
This issue occurred after updating to new Android Studio and build:gradle
. This is not RazorPay sdk issue.
Similar issue is reported in google tracker
To solve this, just downgrade build.gradle
version in your project level build.gradle.
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
...
}
}
This resolved my issue. Hope will do for you too.
回答2:
You can try adding android.enableD8.desugaring = true to gradle.properties
来源:https://stackoverflow.com/questions/50344132/couldnt-find-outer-class-com-razorpay-y-b-of-com-razorpay-y-b5