尝试运行Android App时出现INSTALL_FAILED_MISSING_SHARED_LIBRARY错误 [英] INSTALL_FAILED_MISSING_SHARED_LIBRARY Error When Trying To Run Android App

查看:558
本文介绍了尝试运行Android App时出现INSTALL_FAILED_MISSING_SHARED_LIBRARY错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前从未开发过Android应用,但这并不是一个好的开始. 我在Android Studios上做了一个空白项目作为测试,并尝试在我的Huawei P33手机上运行该程序.当我尝试构建和安装程序时,收到以下消息;

I've never made an Android app before and I'm this isn't a great start. I made a blank project on Android studios as a test and tried to run the program on my Huawei P33 phone. When I attempt to build and install the program, I get the following messages;

无法使用命令cmd软件包提交安装会话389180709 install-commit389180709.错误: INSTALL_FAILED_MISSING_SHARED_LIBRARY:无法安装软件包 在/data/app/com.example.myapplication-segdjrVZj4KvtCNaJ5W5oQ==: 程序包com.example.myapplication需要不可用的共享库 com.google.android.things;失败!

Failed to commit install session 389180709 with command cmd package install-commit 389180709. Error: INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be installed in /data/app/com.example.myapplication-segdjrVZj4KvtCNaJ5W5oQ==: Package com.example.myapplication requires unavailable shared library com.google.android.things; failing!

会话"app":安装未成功. 无法安装该应用程序:INSTALL_FAILED_MISSING_SHARED_LIBRARY 重试

Session 'app': Installation did not succeed. The application could not be installed: INSTALL_FAILED_MISSING_SHARED_LIBRARY Retry

我花了大约一个半小时的时间来搜寻Google,但似乎没有人在Android Things库中遇到同样的问题.

I've spent about an hour and a half googling, but no one has seemed to have the same issue with the Android Things library.

在"AndroidManifest.xml"中,如果我将"<uses-library android:name="com.google.android.things" />"更改为"<uses-library android:name="com.google.android" />",则该应用会安装但不执行任何操作,并且在打开后立即崩溃.

In 'AndroidManifest.xml', if I change <uses-library android:name="com.google.android.things" /> to <uses-library android:name="com.google.android" />, the app installs but does nothing and crashes as soon as it is opened.

推荐答案

您可以将android:required ="false"标志添加到清单文件中,并且应用程序应该能够启动.

You can add android:required="false" flag to your manifest file and the application should be able to start.

<uses-library
     android:name="com.google.android.maps"
     android:required="false"/>

然后,您必须确保保护您的代码以免在需要的地方引发异常

Then you have to make sure to protect your code from throwing an exception in places where you need it

这篇关于尝试运行Android App时出现INSTALL_FAILED_MISSING_SHARED_LIBRARY错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆