安卓集成银联异常解决
问题描述
1. 单独运行没问题,打包成依赖项目出问题
2. 编译器没有异常,安装后一直提示 INSTALL_FAILED_MISSING_SHARED_LIBRARY
Android studio 提示如下
Failed to commit install session 1131706220 with command cmd package
install-commit 1131706220.
Error: INSTALL_FAILED_MISSING_SHARED_LIBRARY:
Package couldn't be installed in
/data/app/com.xx.app-3lBIhJIuX9e-woJL4pRC8A==:
Package com.xx.app requires unavailable shared library
org.simalliance.openmobileapi; failing!
重点是
requires unavailable shared library
org.simalliance.openmobileapi; failing!
解决
错误状态如下:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xx.upplay">
<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />
<application>
<uses-library android:name="org.simalliance.openmobileapi"/>
</application>
</manifest>
解决版本如下:
<uses-library android:name="org.simalliance.openmobileapi"/>
改为:
<uses-library android:name="org.simalliance.openmobileapi" android:required="false"/>
问题分析
<application>
<uses-library
android:name="string"
android:required=["true" | "false"] />
</application>
意义:要安装这个应用是否需要
users-library
指定的库,require=true
没有指定的库报INSTALL_FAILED_MISSING_SHARED_LIBRARY
无法安装。