Ads

[Solved] Cause: error=86 , Bad CPU type in executable - RenderScript App in Android Studio on Mac OS X

I faced this error "cause: error=86 , bad cpu type in executable" when I tried to run my Android application. This app is using render script and I use Mac OS X to run Android Studio IDE. I fixed this error in a crazy amount of time. Let's take it step by step to fix the error for you as well.

Check For Updates

Just check for updates of Android Studio IDE. Update it if there is any updates. Then rebuild the project form the build menu.

If the error still showing up, try the next fix.

Disable The Support Mode for RenderScript

One of the craziest fixes I've ever seen. Just disable the support mode for renderscript as you can see in the following image.

renderscriptSupportModeEnabled

When you disable this support mode, the renderscript works. That's insane. Just set "renderscriptSupportModeEnabled" to "false".

If still the error showing up in the console.

Use Support Library instead of AndroidX

I used androidx libraries but it doesn't work, so I changed it to the old support library for renderscript and it worked fine. The normal support library is "android.renderscript.*" as you can see in the following image.

use android.renderscript instead of androidx library

After those three steps, my renderscript project worked fine. I never seen the bad CPU error again. I hope it works for you too. If you recommend reading this fix, share it on social media. If you want to get new posts, make sure to subscribe to Value In Brief by Email.