相关疑难解决方法(0)

"在外部JAR上转换为Dalvik格式失败,错误为1"

在我在Eclipse中的Android应用程序中,我收到以下错误.

意外的顶级异常:
java.lang.IllegalArgumentException:已添加:Lorg/xmlpull/v1/XmlPullParser;
....
转换为Dalvik格式失败,错误1

仅当我将特定外部JAR文件添加到项目时才会出现此错误.我搜索了很长时间以寻找可能的解决方案,但没有一种可行的解决方案可行.我甚至尝试更改为Android 1.6而不是1.5(我使用的当前版本).

android dalvik android-sdk-1.6

905
推荐指数
31
解决办法
48万
查看次数

proguard地狱 - 找不到引用的类

所以,我TRYING释放一些软件,但Proguard的是让我头疼.

当我尝试使用proguard导出时,我收到很多警告,即"找不到引用的类"

例如:

[2011-08-07 17:44:37 - GAME] Warning: org.simpleframework.xml.stream.StreamReader: can't find referenced class javax.xml.stream.events.XMLEvent
[2011-08-07 17:44:37 - GAME] Warning: there were 52 unresolved references to classes or interfaces.
[2011-08-07 17:44:37 - GAME]          You may need to specify additional library jars (using '-libraryjars'),
[2011-08-07 17:44:37 - GAME]          or perhaps the '-dontskipnonpubliclibraryclasses' option.
[2011-08-07 17:44:37 - GAME] java.io.IOException: Please correct the above warnings first.
[ 
Run Code Online (Sandbox Code Playgroud)

警告似乎与simpleframework有关,所以在我的proguard配置文件中我添加了以下内容:

-libraryjars pathtoprojecttolibs\simple-xml-2.4.jar
Run Code Online (Sandbox Code Playgroud)

pathtoprojecttolibs我的项目引用的jar的路径在哪里.

这没什么区别.

如果simpleframework引用javax我可以告诉proguard也忽略它吗?

有任何想法吗?

android proguard

125
推荐指数
3
解决办法
7万
查看次数

Eclipse保持构建工作空间...和构建工作空间...和构建工作空间

为什么Eclipse在构建Android项目时会陷入构建工作区的无限循环......以及(重新)构建工作区......以及(重新)构建工作区...

这是一个已知的错误?

摆脱这个循环的正确方法是什么?

笔记:

  1. 如果我取消选中Project > Build Automatically,它构建良好,甚至导出一个完美运行的签名版本APK.
  2. 此问题仅在我升级到最新的SDK r19后才开始.在此之前(SDK r11)我从未遇到过这个问题.
  3. 错误160868描述了这个问题.但从那以后它还没有被解决?
  4. 这里有一个类似的问题描述,但与上一个问题相似,它已经过时并且与Android开发没有直接关系.
  5. 问题27940建议处理一个名为const的错误,该错误BuildConfig.DEBUG可能相关也可能不相关.但它没有在r18中修复???
  6. 我在Android构建系统中找到了自动标记/日期戳的这个很棒的提示,但我没有使用任何类似的东西,除了仔细检查和验证构建器按照正确的顺序进行项目构建器列表顺序(相同的顺序)作为其他没有展示这种无限循环构建行为的项目).
  7. 我的预感告诉我可能有一个锁文件或标志以某种方式卡住(只读模式?),从而混淆了构建系统.知道布尔可能是什么以及在哪里找到它?
  8. 如果我首先在同一个工作区中打开另一个项目(没有出现这个问题),那么有这个问题的项目会奇迹般地停止无限重建.如果我颠倒首先打开项目的顺序,就不会发生这种情况.这是否意味着Eclipse/SDK/ADT构建系统中的gremlins?

请不要"盲目拍摄":只有当你亲身经历过这种惊人的现象(并解决它)或者能够指出一篇经历过这种神奇现象(并解决了它)的文章时,才回答这个问题.

eclipse debugging android adt

26
推荐指数
1
解决办法
1万
查看次数

如何降级Android ADT?

最新的Android ADT更新破坏了我的生活.有没有办法下载并安装旧的ADT(14之前)到干净的Eclipse安装?我没有在任何地方找到该文件.

编辑:我不再需要这个,但如果有人知道答案,继续说出来.

android downgrade adt

25
推荐指数
2
解决办法
1万
查看次数

无法导出android应用程序(Eclipse)

我更新了我Eclipse的新版本,现在我无法导出已签名的应用程序.以下是错误报告:

eclipse.buildId=M20110909-1335
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=hr_HR
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

Error
Wed Dec 14 15:58:02 CET 2011
Failed to export application

Command-line Error 2 
Output: 
ERROR: Unknown command 'crunch' 
Android Asset Packaging Tool 

Usage: 
 aapt l[ist] [-v] [-a] file.{zip,jar,apk} 
   List contents of Zip-compatible archive. 

 aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]] 
   badging          Print the label and icon for the app declared …
Run Code Online (Sandbox Code Playgroud)

eclipse android export

12
推荐指数
1
解决办法
1万
查看次数

Proguard和Android :(

我试图在我的Android应用程序上运行Proguard并遇到问题.

我正在使用SpongyCastle jar(复制和过去的完整充气城堡与包重命名,所以它不与版本中建立的机器人充气城堡冲突)

运行proguard时,我看到以下内容

我该如何解决?将rt.jar添加到我的库中?

proguard的重点是缩小代码,但我不断添加jar来解决这些问题,其中proguard抱怨它无法找到一个类!我错过了什么吗?

[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.InitialDirContext
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.InitialDirContext
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.SearchControls
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.SearchControls
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.SearchControls
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.SearchControls
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.SearchControls
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.directory.DirContext
[proguard] Warning: org.spongycastle.x509.util.LDAPStoreHelper: can't find referenced class javax.naming.NamingEnumeration
[proguard] Warning: …
Run Code Online (Sandbox Code Playgroud)

obfuscation android proguard

9
推荐指数
2
解决办法
9356
查看次数

为什么在以前不需要的时候开始排除我自己的应用程序的资源?

我最近遇到了一个令人费解的问题,没有解释我以某种方式设法解决.

该解决方案本身提出了一个问题,我是因为我不明白:它迫使我直接Proguard的忽略关于我自己的应用程序在其包中的所有的警告全部.

-dontwarn com.bta.**
Run Code Online (Sandbox Code Playgroud)

除了在我的开发中忽略关于最容易出错的代码的警告(最常见的代码更改)这一令人不安的问题,我对两个问题感到困惑:

  1. 为什么突然出现这种需求?(我以前从来不需要这样做.)
  2. 为什么我开发的其他项目/应用程序不需要这样做?

我相信我介绍的一些新代码或库导致了这个问题(AdMob?),但对此有何解释?为什么第三方库会强迫我关闭我自己的应用程序资源的警告?

完全关闭我自己的应用程序包的警告有什么副作用(就像我一样)?

android proguard adt admob

7
推荐指数
1
解决办法
127
查看次数

升级到Proguard 4.8后无法导出应用程序

我刚刚将Android SDK,ADT和Proguard升级到最新版本.

我的项目编译构建并在调试模式下运行良好,但是一旦我尝试导出它的签名版本APK,我就会从Eclipse控制台上的导出向导收到错误而没有任何错误日志消息!*

在此输入图像描述

如果我尝试通过Window->Show View->Error Log所有查看错误日志,我看到更多相同:

在此输入图像描述

我不知道该怎么办,因为Eclipse和Proguard都不会暗示问题是什么.

我的项目在最近的升级之前一直很好.没有构建警告.没有棉绒警告!

我正在使用Android的标准配置文件${sdk.dir}\tools\proguard\proguard-android.txt:

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

-dontoptimize
-dontpreverify

-keepattributes *Annotation*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgent
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep …
Run Code Online (Sandbox Code Playgroud)

eclipse android proguard adt android-library

7
推荐指数
1
解决办法
3031
查看次数

Proguard:避免使用预先混淆的库JAR命名冲突

似乎Proguard在重命名/重新打包类时没有尝试避免命名与库JAR中的类的冲突.这是正确的,还是我没有正确配置?

我正在混淆使用最新Google AdMob SDK的Android应用程序.以前我使用旧的AdMob SDK没有问题.新的SDK JAR文件包含一些经过混淆的类.其中一个类a.class位于默认/未命名的包中.当我混淆我的应用程序时,Proguard重命名/重新打包我的一个类也在a.class未命名的包中,尽管已经在AdMob JAR中读取了一个库JAR(因此它应该知道这将导致冲突).可以预见,当dx工具尝试在单个.dex文件中组合这两个具有相同名称的类时,我的构建失败.

作为一种解决方法,我已经重新配置了Proguard,以便它将我的所有类移动到一个命名包(只是一个字母),以避免与Google类冲突,但我很想知道是否有更好的解决方案,或者这是Proguard当前版本(4.6)的限制?

java obfuscation proguard

6
推荐指数
1
解决办法
1193
查看次数

Proguard警告:找不到引用的类Scala。*

升级到新的Android工具后,我收到来自Proguard的以下警告:

Warning: scala.xml.EntityRef: can't find referenced class scala.xml.EntityRef$$anonfun$text$1
Warning: scala.xml.dtd.AttrDecl$: can't find referenced class scala.xml.dtd.AttrDecl$$anonfun$toString$1
Warning: scala.collection.mutable.LinkedListLike: can't find referenced class scala.collection.mutable.LinkedListLike$$anonfun$insert$1
Warning: scala.xml.NamespaceBinding: can't find referenced class scala.xml.NamespaceBinding$$anonfun$toString$1
Warning: scala.xml.NamespaceBinding: can't find referenced class scala.xml.NamespaceBinding$$anonfun$buildString$1
Warning: scala.xml.MetaData$: can't find referenced class scala.xml.MetaData$$anonfun$toString$1
Warning: scala.xml.MetaData$: can't find referenced class scala.xml.MetaData$$anonfun$toString1$1
Warning: scala.collection.immutable.BitSet: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$plus$1
Warning: scala.collection.immutable.BitSet: can't find referenced class scala.collection.immutable.BitSet$$anonfun$$minus$1
Warning: scala.collection.mutable.FlatHashTable$$anonfun$checkConsistent$1: can't find referenced class scala.collection.mutable.FlatHashTable$$anonfun$checkConsistent$1$$anonfun$apply$mcVI$sp$1
Warning: scala.collection.immutable.RedBlack: can't find referenced class scala.collection.immutable.RedBlack$Empty
Warning: scala.collection.immutable.BitSet$: …
Run Code Online (Sandbox Code Playgroud)

java compiler-construction android scala proguard

4
推荐指数
1
解决办法
1634
查看次数

如何修复AdMob导致我的Android应用崩溃?

AdMob已经在我的Android应用程序中工作了一段时间,直到最近我尝试更新时.我试图更新应用程序本身但我看到它一直在崩溃.

我试着调试发生的事情.删除广告后,该应用似乎有效.我现在已经发布了没有任何广告的应用程序,它工作正常.有什么原因可能会突然停止工作?我之前没有更改过任何代码.我更改的唯一代码是我的关系提示应用中的其他提示.

java android admob

0
推荐指数
1
解决办法
1607
查看次数