progaurd不偏食MAC工作 [英] progaurd not working in eclipse mac
问题描述
我创建了最新的ADT一个新的测试项目,并在Eclipse中的所有更新的来源和已编辑的 project.properties 和 proguard的-project.text
我收到以下错误控制台在Mac:
Proguard的错误code 1.见控制台返回
无法访问jar文件/卷/新
我如何解决它,我已经尝试了一切?但仍然得到错误在Mac !!
我真的希望AP preciate任何帮助。
先谢谢了。
proguard的-project.text
#这是ProGuard的配置文件。
#http://proguard.sourceforge.net/index.html#manual/usage.html-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose#优化是默认关闭的。地塞米松不喜欢code运行
#通过ProGuard的优化和preverify步骤(并执行一些
#这些优化自身)的。
-dontoptimize
-dont preverify#如果你要启用优化,您应该包括
#如下:
#-optimizations!code /简化/算术!code /简化/投,!现场/ * ,!类/合并/ *
#-optimizationpasses 5
#-allowaccessmodification
#
#请注意,你不能只是在你自己的这些标志
#配置文件;如果你是包括这个文件,优化
#将被关闭。您需要修改此文件,或
#复制该文件的内容,并移除包括这
从项目的proguard.config path属性#文件。-keepattributes *注释*
-keep公共类*扩展android.app.Activity
-keep公共类*扩展android.app.Application
-keep公共类*扩展android.app.Service
-keep公共类*扩展android.content.BroadcastReceiver
-keep公共类*扩展android.content.ContentProvider
-keep公共类*扩展android.app.backup.BackupAgent
-keep公共类*扩展Android系统。preference。preference
-keep公共类*扩展android.support.v4.app.Fragment
-keep公共类*扩展android.app.Fragment
-keep公共类com.android.vending.licensing.ILicensingService#对于本地方法,请参阅http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames类* {
天然的所述;方法&gt ;;
}-keep公共类*宽android.view.View {
公众和LT; INIT>(android.content.Context);
公众和LT; INIT>(android.content.Context,android.util.AttributeSet);
公众和LT; INIT>(android.content.Context,android.util.AttributeSet,INT);
公共无效套*(......);
}-keepclasseswithmembers类* {
公众和LT; INIT>(android.content.Context,android.util.AttributeSet);
}-keepclasseswithmembers类* {
公众和LT; INIT>(android.content.Context,android.util.AttributeSet,INT);
}-keepclassmembers类*宽android.app.Activity {
公共无效*(android.view.View);
}#对于枚举类,请参见http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers枚举* {
公共静态** []值();
公共静态**的valueOf(java.lang.String中);
}-keep类*实现android.os.Parcelable {
公共静态最终android.os.Parcelable $造物主*;
}-keepclassmembers类**。R $ * {
公共静态<领域取代;
}#支持库包含到新的平台的版本引用。
#不发出警告的情况下,在这个程序是链接到的一个老
#平台版本。我们了解他们,他们是安全的。
-dontwarn android.support。**
project.properties
#此文件是由Android的工具自动生成。
#不要修改此文件 - 您所做的更改都将被删除!
#
#这个文件必须在版本控制系统进行检查。
#
#自定义由Ant构建系统的编辑使用的属性
#ant.properties,并覆盖值到脚本适应你
#项目结构。
#
#为ProGuard的缩小和模糊处理code,取消本(可用的属性:sdk.dir,的user.home):
proguard.config = $ {} sdk.dir /tools/proguard/proguard-android.txt:proguard-project.txt#项目的目标。
目标=机器人-17
我的建议是:
编辑〜/ .profile文件(在文件的最后添加如下几行)
出口ANDROID_SDK_ROOT = /卷/新\\卷\\ E / ADT束-MAC-x86_64的/ ADT束-MAC-x86_64的/ SDK
出口PATH = ANDROID_SDK_ROOT /平台的工具:ANDROID_SDK_ROOT /工具:$ PATH
真的不知道你需要ANDROID_SDK_ROOT /工具,但是可以肯定的...
重新启动ADT(不知道你是否有注销/登录您的账户,如果有必要做到这一点)
希望这有助于
更多的一项评论:尝试移动SDK,以原生Mac卷,如果有可能
编辑:结果〜/ .profile文件
- > 〜是synonim到你的家目录例如 /用户/< your_user_name>
.profile文件是隐藏文件
I created a new test project in latest ADT and all updated sources in eclipse and have edited project.properties and proguard-project.text And I get the following error in console in mac:
Proguard returned with error code 1. See console
Unable to access jarfile /Volumes/New
How do I resolve it I have tried everything ?? But still get the error in mac!!
I really would appreciate any help.
Thanks in Advance.
proguard-project.text
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize
-dontpreverify
# If you want to enable optimization, you should include the
# following:
# -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
# -optimizationpasses 5
# -allowaccessmodification
#
# Note that you cannot just include these flags in your own
# configuration file; if you are including this file, optimization
# will be turned off. You'll need to either edit this file, or
# duplicate the contents of this file and remove the include of this
# file from your project's proguard.config path property.
-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.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment
-keep public class com.android.vending.licensing.ILicensingService
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**
project.properties
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-17
My suggestion is:
edit your ~/.profile file (add the following lines at the end of file)
export ANDROID_SDK_ROOT=/Volumes/New\ Volume\ E/adt-bundle-mac-x86_64/adt-bundle-mac-x86_64/sdk
export PATH=ANDROID_SDK_ROOT/platform-tools:ANDROID_SDK_ROOT/tools:$PATH
really not sure you need ANDROID_SDK_ROOT/tools, but for sure ...
restart ADT (not sure if you have to logout/login your account, do this if necessary)
hope this help
one more comment: try to move SDK to native Mac volume if it is possible
EDIT:
~/.profile
--> ~ is synonim to your home dir e.g. /Users/<your_user_name>
.profile is hidden file
这篇关于progaurd不偏食MAC工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!