Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why install Android LatinIME gets Failure [INSTALL_FAILED_OLDER_SDK]

Tags:

android

apk

sdk

avd

I had download and compiled the source code from GIT, and also successfully runs the emulator compiled along with the code.

Then I managed to use mmm android/packages/inputmethods/LationIME to complie the LatinIME,
and use adb install -r android/out/target/product/generic/system/app/LatinIME.apk and it installed well.

But this only works with the AVD I compiled myself, when I tried to install the LatinIME.apk copied form android/out/target/product/generic/system/app/ to another emulator or a real phone by the same command: adb install -r LatinIME.apk, I get the message:

165 KB/s (568039 bytes in 3.343s)
pkg: /data/local/tmp/LatinIME.apk
Failure [INSTALL_FAILED_OLDER_SDK]

I've Googled a lot and tried what they had say:

  • Add the line <uses-sdk android:MinSdkVersion="3"> in the file `LatinIME/AndroidManifest.xml'

  • Modify the android/build/core/version_defaults.mk, change the line DEFAULT_APP_TARGET_SDK := $(PLATFORM_SDK_VERSION) to DEFAULT_APP_TARGET_SDK := 8

  • I even re-downloaded the source code, the first time I downloaded was the default latest version with API level 10, the second time I download the code of API level 9, both can't complie an pak that can be installed in other emulators on API level 8 or 9 or 10.

I thought it might because that the SDK I complied is AOSP version so it can't be installed in official released SDK? I'm not very clear with the difference.

Anyone having the source code please try mmm android/packages/inputmethods/LationIME and see if the generated apk can be installed in official SDK version?

like image 315
Aloong Avatar asked Oct 11 '22 22:10

Aloong


1 Answers

OK, I'm answering my own question again, I can't understand why my questions always rarely answered.

However I searched the whole Internet and can find a answer, but in luck I saw this:

version_defaults.mk of API Key 7

I simply replaced the android/build/core/version_defaults.mk in my downloaded code tree and re-compiled the module, and it worked!

Thought I don't know if it will work all modules in the source code, but however my IME works good.

like image 166
Aloong Avatar answered Jan 01 '23 10:01

Aloong