Eclipse搭建android wear环境并且新建工程

来源:互联网 发布:vue.js createelement 编辑:程序博客网 时间:2024/05/17 05:57

一、搭建环境

        1、将SDK升级到23

        2、建android wear模拟器

              根据以前创建模拟器的方式一样

          3、启动模拟器,这个过程有点慢,要等一下


二、创建一个helloworld   android wear工程

          1、用图说话

           一路next,就OK了

          2、创建完的工程你会发现报错,解决办法为

     进入如下的目录    /your_android_home/extras/google/m2repository/com/google/android/support/wearable/1.0.0
     你会发现跟wearable相关的一些文件。其中关键的有两个文件。“wearable-1.0.0.aar”和“wearable-1.0.0-javadoc.jar”
     将aar这个文件解压到一个指定的文件夹种,在这个文件夹种创建一个libs子文件夹,然后将classes.jar和wearalbe-1.0.0-javadoc.jar复制到libs目录中。
     接着倒入到eclipse中。并将其设置为Library

          3、代码为 





4、运行过程中遇到的错误

Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.


styles.xml 文件改为<style name="AppBaseTheme" parent="android:Theme.DeviceDefault">  
        <!--  
            Theme customizations available in newer API levels can go in  
            res/values-vXX/styles.xml, while customizations related to  
            backward-compatibility can go here.  
        -->  
    </style>  


Caused by: java.lang.NoClassDefFoundError: android.support.wearable.R$styleable
    at android.support.wearable.view.WatchViewStub.<init>(WatchViewStub.java:52)
    at android.support.wearable.view.WatchViewStub.<init>(WatchViewStub.java:46)


have not included the support-wearable lib project

     

0 0
原创粉丝点击