2

I'm trying to run an android app that was working fine on another computer, but now I am getting an error when I import it. Its telling me that these two libraries are missing:

appcompat_v7\libs\android-support-v4.jar
""\""\android-support-v7-appcompat.jar

I've looked at a lot of other fixes for this error online but it wont work for me. When I go right click and go to package properties, it wont allow me to import thee libraries, they're not there. Also when I right click>android>add support libraries, and after it finished, still same error. I am 99% sure I have android SDK installed correctly. What else could be causing this?

Here's the project.properties

#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project‌​.txt 
# Project target. 
target=android-21 
android.library=false 
android.library.reference.1=../../workspace/appcompat_v7

Screenshot of the error in console

Thanks

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Yurtyya
  • 21
  • 6
  • Do these .jar files exist in your lib folder? – TWL Aug 10 '16 at 13:58
  • I have the v4 jar in the libs folder, but still giving an error for that. I've tried adding a v7 file manually but that doesn't work. I've never had this error so kind of stumped with it really. Here is a screenshot of the errors: https://i.imgur.com/SssVndu.jpg – Yurtyya Aug 10 '16 at 14:26
  • Do you have a proguard.cfg? how does it reference your support jars in there? – TWL Aug 10 '16 at 17:50
  • Am I right in thinking this .cfg file is the same proguard-project.txt file? As I don't see a proguard.cfg file in the root directory of the project. Or is it located somewhere else or am I doing something wrong? However in the 'project.properties' file, its referenced like this, ,maybe it will help: #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. target=android-21 android.library=false android.library.reference.1=../../workspace/appcompat_v7 – Yurtyya Aug 10 '16 at 18:30
  • not the same, but it still provided a clue. "workspace/appcompat_v7" does that directory exist? I believe it's looking for your jars in there since your error states \appcompat_v7\libs\ – TWL Aug 10 '16 at 19:35
  • No that directory does not exist in the current workspace directories root, or root of any of the folders within it. Ill try making that directory now and copy the jar files and see if that solves it. – Yurtyya Aug 10 '16 at 19:51
  • 1
    Any reason not to convert your project into a Gradle project or even import to Android Studio? Then you can stop messing with JAR's and library paths. – OneCricketeer Aug 10 '16 at 19:56
  • there are still people/companies out there that prefer eclipse, but sooner or later... – TWL Aug 10 '16 at 19:57
  • @cricket_007 I'm not even fully sure how to convert the project into a gradle, and it wont successfully import to Android studio due to not a supported gradle wrapper from what I can tell. Im new to Android Studio so maybe theres something I can do there? – Yurtyya Aug 10 '16 at 20:31
  • I'm not sure what you mean by "not a supported Gradle wrapper". You can always download Gradle independently. Even the latest Eclipse Neon supports Gradle projects – OneCricketeer Aug 10 '16 at 20:40
  • Well seems I was importing it wrong originally, it seems to have imported okay now, i'll see how it goes trying to get it to run in Android Studio soon. – Yurtyya Aug 10 '16 at 21:41
  • Getting "Gradle Project Sync Failed" now when I go to run the app in Android Studio. Ill try and get that fixed later. – Yurtyya Aug 10 '16 at 21:47

1 Answers1

0

Okay, I feel like I know what your problem is:

On your other 1st-computer, this project was referencing libraries from another project-library, one that existed in the directory: /workspace/appcompat_v7/

When you copied that project over to a different 2nd-computer and imported it, you forgot to also include that other project-library, but this project is still trying to reference a library that doesn't exist here.

You need to copy over the project-library /workspace/appcompat_v7/ over to your 2nd-computer, then double check / update the library location to match.

TWL
  • 6,228
  • 29
  • 65
  • Oh i see, that would make sense. I've always worked on the one work computer (beginner app developer), and am back working on an android app that hasnt been used in weeks so, but wont be able to get back to that computer until the weekend hopefully. I assume there's not much I can from here other than getting the specific original libraries? If so, let me know , id appreciate it greatly. – Yurtyya Aug 10 '16 at 20:33
  • that /appcompat_v7 should be an auto-generated project-library. You might be able to get your eclipse to generate one for you if you create a new project in your workspace. Just do what this guy did to get what he didn't want: http://stackoverflow.com/questions/22261288/why-does-eclipse-automatically-add-appcompat-v7-library-support-whenever-i-creat – TWL Aug 10 '16 at 20:57
  • Yeah I think it must be possible as a previous person was able to get a slightly earlier version of the app running and the errors removed with just the same folders zipped, so they figured out the issue anyway. Ill try what they did in that link now. – Yurtyya Aug 10 '16 at 21:21
  • This worked! Thanks. It generated the files within the workspace and then strangely allowed me to edit the missing jars in build path to be replaced by these. The only error now its giving me is: "error: No resource identifier found for attribute 'showAsAction' in package 'com.androidapp' Resource: add.xml Path: /AndroidApp/res/menu" Going by a search here, it seems to be related to Appcompat v7 still. Any idea what is wrong as I definitely didn't have this error before also. Thanks! – Yurtyya Aug 10 '16 at 23:47
  • I did yes. It wont let select a lower android ver in the build path as seen here: https://i.imgur.com/vZNDjGx.jpg and my min sdk is 14 and target is 21. I'll keep searching but not sure what the issue is as I didn't have this problem also on the other computer. – Yurtyya Aug 11 '16 at 11:55
  • You are now diverging into a different problem. You should start a new question concerning the resource error and close this one by accepting an answer since your original problem has been answered. – TWL Aug 12 '16 at 06:57