Hello,
I've created a project to bind a java aar. The project is composed of:
The binding projects for the two AAR build correctly but when I build the app, I get the following error:
COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26
After some research I found that it could come from some not supported Java 8 features.
So I added <EnabledDesugar>True</EnabledDesugar>
as a workaround but now I'm getting a:
java.lang.NoClassDefFoundError : org/webrtc/VideoRenderer$Callbacks
The VideoRenderer.Callbacks is present in the referenced AAR and corresponds to a nested interface (a Java 8 feature, isn't ?). It is used in the main AAR.
public class VideoRenderer
{
...
public interface Callbacks
{
void renderFrame(final I420Frame p0);
}
}
I think it's important to add the App build fine when using just the project for the referenced AAR. The error appears when referencing the main binding project.
I know the best would be to wait for the D8 dexer integration in Xamarin, but wouldn't be a workaround in the mean time ?
Thanks
Answers
@wodwob
Please check the following link:
https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/troubleshooting-bindings#problem-noclassdeffounderror-in-packaging
@BillyLiu unfortunately I don't think it's related to the issue. The dependency is there and the project works when using the d8 dexer.