覆盖 AOSP 键盘

问题描述 投票:0回答:1

错误:

原因:java.lang.ClassNotFoundException:在路径:DexPathList[[zip 文件“/data/app/~~6CnZ_EwlgHaoEjQXjHx4lA==/com.android”上找不到类“com.android.inputmethod.latin.CarIME”。 inputmethod.latin-gLDFp7uEfMCiBHMTjxVdHA==/base.apk"],nativeLibraryDirectories=[/data/app/~~6CnZ_EwlgHaoEjQXjHx4lA==/com.android.inputmethod.latin-gLDFp7uEfMCiBHMTjxVdHA==/lib/x86_64, /system/lib64, /系统扩展/lib64]]

清单:

enter image description here

Android.bp 文件

android_app { name: "CustomKeyboard",

certificate: "platform", privileged: true, platform_apis: true,

manifest: "AndroidManifest.xml",

srcs: ["java/**/*.java"],

resource_dirs: ["res"],

overrides: ["LatinIME"],

 libs: [
        "android.car",      
    ],

aaptflags: ["--auto-add-overlay", "--extra-packages",
"com.google.android.material", "--extra-packages",
"androidx.appcompat", "--extra-packages", "androidx.constraintlayout",
"--extra-packages", "androidx.navigation", ],

static_libs: [ "androidx.appcompat_appcompat",
"com.google.android.material_material",
"androidx-constraintlayout_constraintlayout",
"androidx.navigation_navigation-ui",
"androidx.navigation_navigation-fragment", "android.car", ],

 aapt_include_all_resources: true, optimize: { enabled: false,
//proguard_flags_files: ["proguard.flags"], },

dex_preopt: {
        enabled: true, },

product_variables: {
        pdk: {
            enabled: false,
        },
     }, }

我正在尝试覆盖供应商文件夹中的packages/apps/Car/LatinIME/CarLatinIME并创建自定义键盘应用程序。我可以构建 apk,但是在运行应用程序自定义键盘时会崩溃。但是,我遇到了上述错误。可能出了什么问题?

android keyboard android-source ime android-input-method
1个回答
0
投票

好像没有类

com.android.inputmethod.latin.CarIME
,我在AOSP源代码中能找到的最接近的是
com.android.inputmethod.latin.LatinIME
,你可以在这里

找到该类

可能在清单文件中更正此问题将帮助您继续成功构建

<service android:name="com.android.inputmethod.latin.LatinIME">
   // Other code
</service>
© www.soinside.com 2019 - 2024. All rights reserved.