Could not find wearable shared library classes.

2023-12-26 15:30

本文主要是介绍Could not find wearable shared library classes.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

手表开发发生错误

错误:Could not find wearable shared library classes. Please add <uses-library android:name="com.google.android.wearable" android:required="false" /> to the application manifest

大致意思是需要我们在清单文件中添加

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

添加

但添加后还是会出现相同的错误:<uses-library android:name="com.google.android.wearable" android:required="false" />

经过一番尝试后的到的解决方案:在app的build.gradle中发现

 

compileOnly:表示只编译,也就是说在运行时该可穿戴库并不会执行,导致出现上面的错误

修改为:

implementation 'com.google.android.wearable:wearable:2.7.0'

运行后又出现了以下错误:java.lang.RuntimeException:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tpson.myapplication/com.tpson.myapplication.MainActivity}: java.lang.RuntimeException: Stub!

在网上没有找到相关的解决方案后,我又回过来看自己的项目(由于项目新建,只有一个空壳),我找到了,启动的Activity,观察后发现。MainActivity  继承了  WearableActivity

进入  WearableActivity 发现了问题

 

 

WearableActivity  继承了  Activity 但APi指定了 21 

然后查看App的build.gradle 发现使用 21 不可用

然后修改为 

public class MainActivity extends Activity {}

可用,

最终程序如期运行起来了

这篇关于Could not find wearable shared library classes.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/539943

相关文章

MySQL中FIND_IN_SET函数与INSTR函数用法解析

《MySQL中FIND_IN_SET函数与INSTR函数用法解析》:本文主要介绍MySQL中FIND_IN_SET函数与INSTR函数用法解析,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一... 目录一、功能定义与语法1、FIND_IN_SET函数2、INSTR函数二、本质区别对比三、实际场景案例分

Linux find 命令完全指南及核心用法

《Linuxfind命令完全指南及核心用法》find是Linux系统最强大的文件搜索工具,支持嵌套遍历、条件筛选、执行动作,下面给大家介绍Linuxfind命令完全指南,感兴趣的朋友一起看看吧... 目录一、基础搜索模式1. 按文件名搜索(精确/模糊匹配)2. 排除指定目录/文件二、根据文件类型筛选三、时间

Caused by: org.hibernate.MappingException: Could not determine type for: org.cgh.ssh.pojo.GoodsType,

MappingException:这个主要是类映射上的异常,Could not determine type for: org.cgh.ssh.pojo.GoodsType,这句话表示GoodsType这个类没有被映射到

PIL Python Imaging Library (PIL)

介绍         把Python的基础知识学习后,尝试一下如何安装、加载、使用非标准库,选择了图像处理模块PIL。         Python Imaging Library (PIL)是PythonWare公司提供的免费的图像处理工具包,是python下的图像处理模块,支持多种格式,并提供强大的图形与图像处理功能。虽然在这个软件包上要实现类似MATLAB中的复杂的图像处理算法并不

MongoDB学习—(6)MongoDB的find查询比较符

首先,先通过以下函数向BookList集合中插入10000条数据 function insertN(obj,n){var i=0;while(i<n){obj.insert({id:i,name:"bookNumber"+i,publishTime:i+2000})i++;}}var BookList=db.getCollection("BookList")调用函数,这样,BookList

Hibernate插入数据时,报错:org.springframework.dao.DataIntegrityViolationException: could not insert: [cn.itc

在用junit测试:插入数据时,报一下错误: 错误原因: package junit;import org.junit.Test;import cn.itcast.crm.container.ServiceProvinder;import cn.itcast.crm.dao.ISysUserDao;import cn.itcast.crm.domain.SysRole;

error while loading shared libraries: libnuma.so.1: cannot open shared object file:

腾讯云CentOS,安装Mysql时: 1.yum remove libnuma.so.1 2.yum install numactl.x86_64

【NodeJS】Error: Cannot find module 'ms'

转载自:http://blog.csdn.net/echo_ae/article/details/75097004 问题: Error: Cannot find module 'ms'at Function.Module._resolveFilename (module.js:469:15)at Function.Module._load (module.js:417:25)at Module

leetCode#448. Find All Numbers Disappeared in an Array

Description Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this

访问controller404:The origin server did not find a current representation for the target resource

ider build->rebuild project。Rebuild:对选定的目标(Project),进行强制性编译,不管目标是否是被修改过。由于 Rebuild 的目标只有 Project,所以 Rebuild 每次花的时间会比较长。 参考:资料