Uncaught translation error: com.android.dx.cf.code.SimException: local 0002: invalid

妖精的绣舞 提交于 2019-12-13 15:39:03

问题


I am trying to install an FPC program on to android device by following this article.

While creating .dex file by giving the input as .jar (classes.jar) file, it is giving the following error.

MacBookPro:src Sreehari$ /Library/android-sdk-macosx/build-tools/23.0.2/dx --dex --output=bin/classes1.dex eu/blaisepascal/skeletonapp/skeltonapp.jar Uncaught translation error: com.android.dx.cf.code.SimException: local 0002: invalid 1 error; aborting

I have seen on internet that it is because of not giving pro-guard, is it true? How do I give pro-guard?


回答1:


It can also happen when you have "Instant Run" enabled




回答2:


Not sure what you mean by giving pro-guard but I will give a general answer to the problem as I encountered the same error in the past and this is what worked for me.

The simplest way of solving this compilation error is by setting minifyEnabled to false in your build's gradle file. This solution will skip running pro-guard among minifying the apk size, something that's not acceptable in many situations.

The more general solution is to update google play services or find a library used in your project that's using an old version of it.




回答3:


Try to disable Instant Run in Android Studio

  1. Open the Settings or Preferences (Mac) dialog.
  2. Navigate to Build, Execution, Deployment > Instant Run.
  3. Uncheck the box next to disable Instant Run.


来源:https://stackoverflow.com/questions/37745659/uncaught-translation-error-com-android-dx-cf-code-simexception-local-0002-inv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!