解决Eclips中使用V7兼容包的主题报错的问题

来源:互联网 发布:中国建设银行总行 知乎 编辑:程序博客网 时间:2024/06/01 07:12

   新建项目默认会使用v7包中的主题,如果你workplace中没有v7库,那是一定会报错的。

  1、导入v7jar,没用,因为需要的是v7的资源文件

  2、既然如此,导入v7的整个项目应该ok了吧,import之后,尼玛还报错,百思不得骑姐,删了导,导了删,把SDK都弄坏了还是报错。并且build path还不报错。

  终极大招,原来原因是因为v7库和项目没有在一个盘符下,import的时候,注意要勾选copy projects into workplace,也就是把依赖库从sdk复制一份到当前的workplace下,另外,项目要是从别的地方导入的时候,也要拷一份到当前eclipse的workplace下,此类问题可解。

  原因:正常情况下,project.properties有:

# This file is automatically generated by Android Tools.# Do not modify this file -- YOUR CHANGES WILL BE ERASED!## This file must be checked in Version Control Systems.## To customize properties used by the Ant build system edit# "ant.properties", and override values to adapt the script to your# project structure.## To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt# Project target.target=android-21android.library.reference.1=../android-support-v7-appcompat

  windows下,project要和library project 在通一个盘符下,如果不在一个盘符下,project.project中的android.library.reference.1的值会变为绝对路径,Adt推荐是在linux(ubuntu)下使用的,对windows绝对路径支持有bug,所以会找不到,造成错误。

0 0
原创粉丝点击