`
Beaver's
  • 浏览: 394627 次
  • 性别: Icon_minigender_2
  • 来自: 天津
社区版块
存档分类
最新评论

Android开发时提示Your project contains error(s),please fix them before running yourap

 
阅读更多
使用eclipse写好Android的代码,代码没有报错。想在AVD中运行测试时,总是会弹出错误框,提示信息为:

“Your project contains error(s),please fix them before running your application.”

不管是重启AVD 重启eclipse 甚至创建一个新的Android工程项目都不能运行

上网查找原因,有几种可能:

1.在不同的电脑下开发,而且文件存放路径不同,错误的主要原因是  “.classpath”  文件的载三方类库包路径错误。

2.也可能是你的SDK版本不存在或者没有。

3.编译的class、apk文件有问题:执行清除一下就可以了。Project→Clean→Clena Projects Selected Below 选择你出错的项目就可以了。

4.有可能就是最重要的这一点:
在Program提示框中会提示:
“Error generating final archive: Debug Certificate expired on 12-7-25 下午7:52”


原因分析:

android要求所有的程序必须有签名,否则就不会安装该程序。在我们开发过程中,adt使用debug keystore,在 preference->android->buid中设置。debug的keystore默认有效期为一年,如果你是从一年前开始完android程序,那么在一年后导入这个app的时候很可能出现debug keystore过期,导致你无法生成apk文件。

此时你只要删除debug keystore就行,系统又会为你生成有效期为一年的私钥。


解决方法:

进入C:\Documents and Settings\Administrator\.android 删除路径下的debug.keystore及ddms.cfg。

(不同环境下的目录可能略有不同,可在eclipse中查找此路径:Window->Preferences->Android->Build下 Default debug keystore)

我出错的原因是第4种,我直接删除了.android 文件,成功解决问题
分享到:
评论

相关推荐

    解决AndroidStudio导入项目卡死在“building gradle project info”问题

    在使用Android Studio进行开发时,开发者经常会遇到在导入项目的过程中出现卡死现象,尤其是在“building gradle project info”阶段。这个问题严重影响了开发效率,给开发者带来了很多不便。本文将详细介绍该问题...

    android sdk 自带 实例(samples)

    A sample application that demonstrates Android's search framework, including how to provide search suggestions for Quick Search Box. Snake An implementation of the classic game "Snake." Soft ...

    The Android Developer's Cookbook Building Applications and Source Project

    The Android Developer's Cookbook Building Applications with the Android SDK and Source Project Code 源书(pdf)及源代码12章全都有(rar) Book Description Want to get started building applications for ...

    Android开发环境搭建步骤

    启动 Eclipse,选择 File -> New -> Project,选择 Android -> Android Project,然后选择 Create New Project in Workspace,输入项目名称,选择 Android 版本,选择 Create Project。然后,创建一个新的 Activity...

    Android创建Library Project(库项目)与引用操作

    在Android开发中,Library Project(库项目)是一个重要的概念,它允许开发者将可重用的代码、资源和组件封装在一个独立的模块中,以便在多个应用程序之间共享。本篇文章将详细讲解如何创建一个Android Library ...

    android 4.0 api project

    Android 4.0 API项目,也被称为"Ice Cream Sandwich"(ICS),是Android操作系统的一个重要版本,它在2011年发布,带来了许多新功能和改进。这个ApiDemos项目是一个示例代码集合,旨在帮助开发者更好地理解和利用...

    新版Android开发教程.rar

    Note: Note: Note: Note: If JDK is already installed on your development computer, please take a moment to make sure that it meets the version requirements listed above. In particular, note that some ...

    Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+ *****

    在Android开发过程中,经常会遇到"Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+”这样的错误提示,这是由于依赖库无法正确解析导致的。该错误通常涉及到Android支持库版本不匹配或者...

    Android代码-SGit

    A Git client for Android. This project is no longer being maintained. Further development on this app is now being done in the MGit project. Please submit all PRs and issues there. Notes All ...

    搭建Android Studio开发环境

    搭建Android Studio开发环境是Android应用开发的首选途径,因为它提供了许多优于传统Eclipse IDE的优势。首先,Android Studio在UI设计和编码方面提供了更强大的支持,它内置的布局编辑器允许开发者直观地调整不同...

    AndroidStudio更新出现Refreshing ‘xxx’ Gradle Project状态解决办法

    开发项目之前,我用的是AndroidStuio2.1.0版本,项目开发完后,按耐不住就更新编译环境了。编译环境更新至AndroidStuio2.2.2. 更新完后,激动的打开AndroidStudio,原来的项目就处于如下状态: 本来以为这是更新...

    AndroidStudio 使用过程中出现的异常(Gradle sync failed)处理办法

    本文主要介绍AndroidStudio 使用过程中出现的异常的解决办法,这里帮大家举例说明,如何处理出现这种问题,有需要的小伙伴可以参考下

    project软件项目开发计划模板

    利用project设计的软件开发项目计划(甘特图).里面是一个真实的项目计划,而且基本包含了软件开发的各个部分.

    Android代码-WeShareWiFiSDK

    If the native “so” file in your project only supports certain cpu platfrom, please exclude other “so” in build.gradle. Our aar contains all cpu platforms. Fow example, my app project only uses ...

    android桌面小部件开发

    你需要在Android Studio中选择"New Project",然后在模板中选择"Empty Activity"。接着,在项目的`res/layout`目录下创建一个新的XML布局文件,用于定义小部件的界面。这个布局通常包含一些简单的UI元素,如TextView...

    搭建Android开发环境和构建第一个Android程序(Android studio版)

    搭建Android开发环境是每个Android开发者入门的必经之路,而Android Studio作为官方推荐的集成开发环境,其功能强大且易用。本教程将详细介绍如何在Windows操作系统上使用Android Studio搭建开发环境并创建第一个...

    Android-Code.zip_Check_ Please!

    【Android 应用开发简介】 Android 是一个开源的移动操作系统,主要由谷歌公司主导开发,广泛应用于智能手机和平板电脑。Android 提供了一个丰富的开发环境,让开发者能够创建各种各样的应用程序,服务于全球数亿...

    Python实现django开发的在线计算器实例-ComputeDemo

    Before running this project, you may want to create a super user. Synchronize the Database This project has default settings for the database (it uses sqlite). If you need a super user, you'll need ...

Global site tag (gtag.js) - Google Analytics