简体   繁体   English

Android Grid View转换为Dalvik格式失败错误

[英]Conversion to Dalvik format failed error for Android Grid View

I'm on the android bandwagon and started going through google's "view" tutorials. 我在android潮流中,开始浏览Google的“查看”教程。 Here is what I'm using: Eclipse Galileo Android SDK 2.1 Java SDK 6.Something I think. 我正在使用的是:Eclipse Galileo Android SDK 2.1 Java SDK 6.我认为。

Everything was hunky-dory until I hit the grid view tutorial. 一切都是笨拙的,直到我点击了网格视图教程。 I got errors all over the place when I started editing the "HelloGridview.java" File. 当我开始编辑“ HelloGridview.java”文件时,到处都是错误。 I thought I'd fix it by following through with the next part of the tutorial, creating the ImageAdapter class, but it created more. 我以为我可以通过完成本教程的下一部分来解决它,创建ImageAdapter类,但是它创建了更多内容。 I realized alot of my issues could be resolved by importing widgets which were not mentioned in the tutorial (ie android.widget.GridView, .ImageView, .BaseAdapter etc.) However, after all the reconciliation suggested by eclipse the files were finally showing no errors. 我意识到很多问题都可以通过导入本教程中未提及的小部件来解决(例如android.widget.GridView,.ImageView,.BaseAdapter等)。但是,在eclipse建议的所有协调之后,这些文件最终都没有显示错误。 I go to run it as an android app and bam, "Your project contains error(s)." 我将其作为android应用程序和bam运行,“您的项目包含错误。” window comes up. 窗口出现。 There are no errors showing on the files I've created. 我创建的文件上没有显示任何错误。 I cleared the error log and shut down eclipse and started again the error log now reads: Conversion to Dalvik format failed with error 1. I'm a little lost at this point. 我清除了错误日志并关闭了Eclipse,然后再次开始读取错误日志:现在,转换为Dalvik格式失败,错误为1。这时我有点迷失了。 I think I've included the required information. 我想我已经包括了必填信息。 If you need to know more let me know. 如果您需要了解更多,请告诉我。

Any help is appreciated. 任何帮助表示赞赏。

I had the same problem. 我有同样的问题。 Eclipse imported a jar in the java build path and this somehow caused the error. Eclipse在Java构建路径中导入了一个jar,这导致了错误。

Right Click o the project -> Java Build Path and make sure you have only once imported android.jar. 右键单击项目-> Java构建路径,并确保仅导入一次android.jar。

Some of those examples on the Android developer site are a trifle out of date, and so it may be that the one giving you grief is no longer a great example to work from. Android开发人员网站上的一些示例有些过时了,因此可能给您带来痛苦的示例不再是一个可以使用的好示例。

Try this GridView sample for something that definitely works on current versions of Android. 尝试使用GridView示例获取肯定适用于当前版本的Android的示例

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

相关问题 Android项目:转换为Dalvik格式失败,错误1 - Android project: Conversion to Dalvik format failed with error 1 转换为Dalvik格式失败,并在Android中出现错误Apache poi - Conversion to Dalvik format failed with error Apache poi in Android 如何解决转换为Dalvik格式失败并出现错误 - How to solve the Conversion to Dalvik format failed with error 在Mac上的Eclipse上,转换为Dalvik格式失败,并出现错误1 - Conversion to Dalvik format failed with error 1 on Eclipse for Mac 添加jar文件导致Android项目错误:转换为Dalvik格式失败,错误为1 - Adding jar file cause Android project error: Conversion to Dalvik format failed with error 1 在android ADT build v22.3.0-887826中错误1转换为Dalvik格式失败 - Conversion to Dalvik format failed with error 1-in android ADT build v22.3.0-887826 转换为Dalvik格式失败eclipse android-suport-v4.jar错误 - Conversion to Dalvik format failed eclipse android-suport-v4.jar error 转换为Dalvik格式失败,并在libgdx中出现错误1奇怪的错误 - Conversion to Dalvik format failed with error 1 Weird error in libgdx Android:转换为Dalvik格式失败:无法执行dex:null - Android: Conversion to Dalvik format failed: Unable to execute dex: null 获取错误:转换为Dalvik格式失败:无法执行dex: - Getting Error: conversion to Dalvik format failed: Unable to execute dex:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM