Android Error: Error converting bytecode to dex:

created at 07-10-2021 views: 1

description

When I connected to the RN, I needed to modify the original old project. I encountered many problems when compiling and running. The most headache is this

Error:Error converting bytecode to dex:

class name (us/webView/BSDialogUtilsForWebView) does not match path (us/webview/BSDialogUtilsForWebView.class)
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --force-jumbo --num-threads=4 --multi-dex --output /Users/majianguang/work/androidwork/android-idcamera/app/build/intermediates/transforms/dex/debug/folders/1000/5/slice_8 /Users/majianguang/work/androidwork/android-idcamera/app/build/intermediates/transforms/instantRunSlicer/debug/folders/1/5/slice_8}

I checked countless methods on the Internet, but they didn’t work. I said that there may be repeated importing of the package, or the code method may exceed the standard, etc., and I added it and tried it.

solution

Finally, I found that it was a problem of hot compilation and subcontracting. I don’t know the specifics, but there may be a problem with Android Studio 2.3.3

Open the preferences of Android Studio:

Android Studio

Just remove the check mark in the figure above, no need to update and compile in real time.

Then the problem is solved.

Please log in to leave a comment.