问题
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
- Open the Settings or Preferences (Mac) dialog.
- Navigate to Build, Execution, Deployment > Instant Run.
- 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