簡體   English   中英

android應用程序中的proguard

[英]proguard in android application

我在應用程序中使用諸如foursquare api和ABS庫之類的外部庫。

當我在導出應用程序之前啟用proguard時,控制台中出現以下提到的錯誤。

Proguard返回了錯誤代碼1。請參見控制台注意:共有3686個重復的類定義。 警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPMethod警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的com.google.appengine.api.urlfetch.HTTPMethod類fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的com.google.appengine.api.urlfetch.HTTPRequest類警告:fi.foyt.foursquare.api .io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.FetchOptions $ Builder警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine。 api.urlfetch.FetchOptions警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPRequest警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.URLFetchServiceFactory警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.URLFetchService rning:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPResponse警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的com.google.appengine.api.urlfetch.HTTPResponse類警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的com.google.appengine.api.urlfetch.HTTPMethod類警告:fi.foyt.foursquare .api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPMethod警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine。 api.urlfetch.FetchOptions $ Builder警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.FetchOptions警告:fi.foyt.foursquare.api.io。 GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.URLFetchServiceFactory警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.URLFetchS ervice警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPResponse警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPMethod警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.HTTPRequest警告:fi.foyt。 foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine.api.urlfetch.URLFetchService警告:fi.foyt.foursquare.api.io.GAEIOHandler:找不到引用的類com.google.appengine .api.urlfetch.HTTPResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax .servlet.http.HttpServletRequest警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletReque st警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http。 HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletRequest fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletRequest警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletRequest警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletRequest Wa rning:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletRequest警告:fi.foyt.foursquare.example.AuthenticationExample:找不到引用的類javax.servlet.http.HttpServletResponse您應該檢查是否需要指定其他程序jar。 警告:有35個未解決的對類或接口的引用。 您可能需要指定其他庫jar(使用'-libraryjars')。 java.io.IOException:請首先更正以上警告。 在proguard.ProGuard.main(ProGuard.java :)的proguard.ProGuard.execute(ProGuard.java:86)的proguard.ProGuard.initialize(ProGuard.java:211)的proguard.InGuardal.execute(Initializer.java:321) 492)

我知道我必須提到Proguard屬性文件中的外部庫。 我要提的是問題所在。

請參閱我的proguard文件

-injars      bin/classes
-outjars     bin/classes-processed.jar
-libraryjars E:/android/adt-bundle-windows-x86_64-20131030/sdk/platforms/android-19/android.jar

-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*

-keep public class * extends android.app.Activity

-keep public class * extends android.app.Service

-keep public class * extends android.content.BroadcastReceiver


-keep public class * extends android.content.ContentProvider

-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}

如果您要使用Android插件導出Android應用程序,則該插件已經為您指定了標准配置。 此配置包括基本的-keep選項以及所有必需的-injars和-outjars選項(因此,請注意有關重復類定義的說明)。 這意味着您的proguard-project.txt文件可以為空; 它僅應包含任何特定於項目的配置。

警告說明,Foursquare庫引用了AppEngine庫,甚至引用了servlet庫,但是項目中缺少這些后者庫。 沒問題,因為您的應用大概可以在調試模式下正常運行,並且沒有這些庫,因此您可以告訴ProGuard忽略以下問題:

-dontwarn fi.foyt.foursquare.**

請參閱ProGuard手冊>故障排除> 警告:找不到引用的類

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM