appcompat v7 package does not exist

天涯浪子 提交于 2019-12-11 03:23:15

问题


Using tools 23.0.2 And latest SDK

Using manual ant build.

I've checked my xml resources for errors.
I've run them through tidy and they are ok. I've cleaned the project.

But still I'm getting errors trying to use appcompat v7 support library.

here's where I have the appcompat_v7 library:

$ ls  ../sdk/extras/android/support/v7/appcompat/
AndroidManifest.xml  build.xml  libs              proguard-project.txt  README.txt  src
bin                  gen        local.properties  project.properties    res

And in my main project project.properties:

android.library.reference.4=../sdk/extras/android/support/v7/appcompat

When I run 'ant debug' it builds the appcompat library classes.jar

Here's the generated classes.jar and R.java:

$ ls -l ../sdk/extras/android/support/v7/appcompat/bin/classes.jar 
-rw-rw-r--. 1 androidin androidin 538 Jul 19 12:24    ../sdk/extras/android/support/v7/appcompat/bin/classes.jar

$ ls -l ../sdk/extras/android/support/v7/appcompat/gen/android/support/v7/appcompat/R.java 
-rw-rw-r--. 1 androidin androidin 174070 Jul 19 12:24 ../sdk/extras/android/support/v7/appcompat/gen/android/support/v7/appcompat/R.java

And here's the errors I'm seeing:

ListPopupWindow.java:26: error: package android.support.v7.appcompat does not exist
[javac] import android.support.v7.appcompat.R;

What else is needed?


回答1:


In case anyone else runs into this issue:

The problem stemmed from utilizing a file from part of the support library itself.

All I needed to modify in that file was the following:

import android.support.v7.appcompat.R;
to
import my.package.R;


来源:https://stackoverflow.com/questions/24842927/appcompat-v7-package-does-not-exist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!