0

I followed the full instruction in Quick Start to configure the android-beacon-library in Eclipse, but I fail to run my app. I have no idea how to fix the problem.

My steps are as follows,

Step 1. Import the library into Eclipse

Step 2. Add the library to my project

Step 3. Add sdk and permission declarations to your AndroidManifest.xml

Step 4. Edit your project.properties file and add the line: manifestmerger.enabled=true

Step 5. Paste the Monitoring Example Code in my MainActivity. And set the beacon layout conforming to the iBeacon protocol.

Then, problem occured. As it shows below, my project seemed to know nothing about the existence of the android-beacon-library. error in Eclipse

Then, I used the Project Setup Fixes, and added the android-beacon-library to build path. enter image description here.

After that, there's no error in the project, then I run my project using Nexus 5. However, new problem occured. Here's what the console prints out. enter image description here

And, I go to Go to Project -> Properties -> Android -> Library again, to find that the android-beacon library which I succeeded to add in Step 2 turned to be as follows.enter image description here

Am I missing some step?

  • possible duplicate of [Could not find Library.apk!](http://stackoverflow.com/questions/6337673/could-not-find-library-apk) – Tim Oct 29 '14 at 12:51

2 Answers2

2

Red cross mean broken reference to solve that problem you should copy android beacon library in eclipse workspace and then import that library in eclipse.

In your case you have to move android beacon library from E drive to Eclipse workspace and then import it in Eclipse.

After that you can successfully use that library with green tick symbol in your project.

Manish Butola
  • 557
  • 6
  • 15
0

You need to fix the library reference under Project -> Properties -> Android -> Library where you see the red X. Remove that reference, then click Add, and browse for were the android-beacon-library is located. If you don't see android-beacon-library as an option, then make sure it exists as a proper Android Library Project in your workspace.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204
  • I remove the red X reference, then add android-beacon-library again, and then the red X turned into green correct mark. But after running, the console print "Could not find android-beacon-library.apk" again, and the green correct mark turned to red X again. I did what you suggest several times, but once I run my app, the green correct mark turned into red X – Zhanyun Xiong Oct 29 '14 at 13:46
  • When you run the project, it looks like Eclipse is attempting to run both the android-beacon-library project and the beaconlibtest project as separate Android applications. The fact that Eclipse is trying to build a android-beacon-library.apk is a problem. There should be no apk generated for library projects. You need to figure out why this is happening, and stop it, because it is probably generating an unusable build for the android-beacon-library. If all else fails, delete the android-beacon-library entirely and start over with the instructions to install it in Eclipse. – davidgyoung Oct 29 '14 at 15:08
  • It doesn't work. I'm considering whether there are any alternative ways to use the android-beacon-library in Eclipse. For instance, copy the **classes.jar** file in directory **android-beacon-library/libs**, then paste it in **MyProject/libs**, and right click to add the jar file pasted to build path. I presume that the **classes.jar** is an archive of all the class file of the **android-beacon-library**. Am I suppose to use the library this way? – Zhanyun Xiong Nov 03 '14 at 09:20
  • If you cannot get an Eclipse library project working, then you can do this. But you must also manually copy all the AndroidManifext.xml entries from the library. – davidgyoung Nov 03 '14 at 13:00