简体   繁体   English

如何运行一个android库项目?

[英]How to run an android library project?

I want to make a Google Maps Android project, but when I use the google play service library in the project and i click Run as => Android Application .我想制作一个 Google Maps Android 项目,但是当我在项目中使用 google play 服务库并单击Run as => Android Application It gives the error " Android Library project cannot be launched ".它给出了错误“ Android Library project cannot be launched ”。 I tried many methods to solve this problem like: check or uncheck the "is Library" checkbox.我尝试了很多方法来解决这个问题,例如:选中或取消选中“is Library”复选框。 But to no avail.但无济于事。


  1. When I check the "is Library" checkbox it give the error "Android Library cannot be launched"当我选中“是库”复选框时,它会给出错误“无法启动 Android 库”
  2. When I unchecked "is Library" checkbox it gives the error after some time "Unable to execute dex:GC Overhead Limit Exceed"当我取消选中“是库”复选框时,它会在一段时间后出现错误“无法执行 dex:GC 开销限制超出”

I fixed my problem.我解决了我的问题。

How to run an android library project?如何运行一个android库项目?

You do not run an Android library project.您不运行 Android 库项目。 You use an Android library project to add functionality to an Android application project.您可以使用 Android 库项目向 Android 应用程序项目添加功能。 You then run the Android application project.然后运行 ​​Android 应用程序项目。

I want to make a Google Maps Android project我想做一个谷歌地图安卓项目

Follow the instructions to add the Play Services SDK to your Eclipse project.按照说明将 Play Services SDK 添加到您的 Eclipse 项目。 Then follow the instructions to use the Play Services SDK to create an application that uses the Maps V2 API.然后按照 说明使用 Play Services SDK 创建使用 Maps V2 API 的应用程序。

When I change the value of eclipse.ini file like below :当我更改eclipse.ini文件的值时,如下所示:

--launcher.XXMaxPermSize
256M
-Xms40m
-Xmx512m

It Solved my problem.它解决了我的问题。

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

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