简体   繁体   English

如何使用 ionic cordova 生成适用于 Android 4.1.2 的 APK

[英]How to generate an APK for Android 4.1.2 with ionic cordova

I just got into android programming with ionic and cordova.我刚开始使用 ionic 和cordova 进行android 编程。 I installed the latest versions of ionic and cordova.我安装了最新版本的 ionic 和cordova。 the problem is when I build, the apk does not install on my android 4.1.2 What can I do问题是当我构建时,apk 没有安装在我的 android 4.1.2 上我该怎么办

Config.xml配置文件

change line换线

 <preference name="android-minSdkVersion" value="19" />

To

<preference name="android-minSdkVersion" value="16" />

Hope it will help you out.希望它能帮到你。

I received this message :我收到了这条消息:

FAILURE: Build failed with an exception. FAILURE:构建失败,出现异常。

  • What went wrong: Execution failed for task ':app:processReleaseManifest'.出了什么问题:任务 ':app:processReleaseManifest' 执行失败。

    Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:CordovaLib] C:\\Users\\Azman\\Projets\\test5\\platforms\\android\\CordovaLib\\build\\intermediates\\library_manifest\\release\\AndroidManifest.xml as the library might be using APIs not available in 16 Suggestion: use a compatible library with a minSdk of at most 16, or increase this project's minSdk version to at least 19, or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)清单合并失败:uses-sdk:minSdkVersion 16 不能小于在库 [:CordovaLib] C:\\Users\\Azman\\Projets\\test5\\platforms\\android\\CordovaLib\\build\\intermediates\\library_manifest\\release\\AndroidManifest 中声明的版本 19。 xml,因为库可能使用了 16 中不可用的 API 建议:使用 minSdk 最多为 16 的兼容库,或将此项目的 minSdk 版本增加到至少 19,或使用 tools:overrideLibrary="org.apache.cordova"强制使用(可能导致运行时失败)

  • Try: Run with --stacktrace option to get the stack trace.尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output.使用 --info 或 --debug 选项运行以获得更多日志输出。 Run with --scan to get full insights.使用 --scan 运行以获得完整的见解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM