I tried looking into similar problems, but the solutions offered there do not seem to fit my particular situation:
I initially followed the instructions for Configuring and building the sample application for In-app Billing, replacing the security key with the public key from Google's Developer account and changing the package name from com.example
to com.billtheape
.
I then built a non-release version and ran a "sanity check" on my Android phone. Everything went OK (except for accessing the Android Market server, of course, since by design it only works with a signed release version).
Then I tried to build a signed release version, but received the error:
[2012-01-03 20:52:45 - Dex Loader] Unable to execute dex:
Multiple dex files define Lcom/android/vending/billing/IMarketBillingService;
[2012-01-03 20:52:45 - Dungeons] Conversion to Dalvik format failed:
Unable to execute dex: Multiple dex files define Lcom/android/vending/billing/IMarketBillingService;
The problem now is that even the "debug version" building generated the same error, regardless of how many times I tried to clean the project.
This didn't look to me like a Build Path issue in the sense that the accepted answer described (I checked that, too, but couldn't find anything suspicious). So I tried something else:
- Exited Eclipse
- Spotted three subdirectories under
%ANDROID_HOME%extrasgooglemarket_billinggencom
: (1) android
(2) example (3) billtheape
- Deleted the subdirectory
example
.
- Started Eclipse and cleaned the project.
Debug version builds now properly, but signed release still generates the same error. It turns out that deleting that extraneous subdirectory wasn't what did the magic, but rather restarting Eclipse and then cleaning the project.
OK, so at least I got the "debug version" working back, but the signed release Export keeps failing with the same error.
Any idea what this error means, why it happens and how to fix it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…