简体   繁体   English

Android中的多个图书馆项目

[英]Multiple Library Projects in Android

Can we use two library projects in android? 我们可以在android中使用两个库项目吗? I want to use map_lib and google_play-services-lib in my android project. 我想在我的Android项目中使用map_libgoogle_play-services-lib map_lib for displaying the Google Map in my app and google_play-services-lib for getting GPS values to track the user. map_lib用于在我的应用程序中显示Google Map,而google_play-services-lib用于获取GPS值以跟踪用户。 If i add both the Library projects in my app, my R.java file is missing. 如果我在我的应用程序中都添加了两个Library项目,则缺少R.java文件。 I know we can do both tasks using map_lib . 我知道我们可以使用map_lib来完成这两项任务。 But i want to use it seprately. 但我想单独使用它。

Kindly help me with this. 请帮助我。 Thanks in advance. 提前致谢。

是的,您当然可以,请确保已将项目导入工作空间中并将其添加到构建路径,然后清理项目并重新启动Eclipse。

Check Console you get Jar mismatch. 检查控制台,您会发现Jar不匹配。

add same android-support-v4.jar file in every project not int (Google-play-service). 在每个不是int的项目中添加相同的android-support-v4.jar文件,而不是int(Google-play-service)。

You can add n numbers of libs. 您可以添加n个库。

STEPS:- 1)take any android-support-v4.jar file from your application project /library project. 步骤:-1)从您的应用程序项目/ library项目中获取任何android-support-v4.jar文件。 2)paste android-support-v4.jar file in both project libs folder. 2)将android-support-v4.jar文件粘贴到两个项目libs文件夹中。 3)done.enjoy 3)done.enjoy

First import both library properly. 首先正确导入两个库。 Then go properties->java buildpath then check wether your library is checked or not. 然后去properties-> java buildpath,然后检查是否检查了您的库。 then clean your project. 然后清理您的项目。

Yes we can use any number of library files in our projects. 是的,我们可以在项目中使用任意数量的库文件。 If any mistakes in xml files R.java won't created. 如果xml文件中有任何错误,将不会创建R.java。 Try to check it. 尝试检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM