新建项目时提示:proguard.cfg 系统找不到指定的文件<wbr>如图:</wbr>
<wbr></wbr>
<wbr></wbr>
解决方法:
方法一:在<wbr>\android-sdk-windows\tools\lib\目录下新建proguard.cfg文件</wbr>
内容如下:
-optimizationpasses 5
-dontusemixedcaseclassnam<wbr>es<br> -dontskipnonpubliclibrary<wbr>classes<br> -dontpreverify<br> -verbose<br> -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*<br> -keep public class * extends android.app.Activity<br> -keep public class * extends android.app.Application<br> -keep public class * extends android.app.Service<br> -keep public class * extends android.content.BroadcastReceiver<br> -keep public class * extends android.content.ContentProvider<br> -keep public class com.android.vending.licensing.ILicensingService<br> -keepclasseswithmembernam<wbr>es class * {<br> native ;<br> }<br> -keepclasseswithmembernam<wbr>es class * {<br> public (android.content.Context, android.util.AttributeSet);<br> }<br> -keepclasseswithmembernam<wbr>es class * {<br> public (android.content.Context, android.util.AttributeSet, int);<br> }<br> -keepclassmembers enum * {<br> public static **[] values();<br> public static ** valueOf(java.lang.String);<br> }<br> -keep class * implements android.os.Parcelable {<br> public static final android.os.Parcelable$Creator *;<br> }</wbr></wbr></wbr></wbr></wbr>
<wbr></wbr>
方法二:通过Android SDK and AVD Manager更新SDK。
本文介绍了解决新建项目时出现的proguard.cfg文件缺失问题。提供了两种解决方案:一种是在指定目录下创建proguard.cfg文件并填充必要配置;另一种是通过更新Android SDK来修复该问题。

6万+

被折叠的 条评论
为什么被折叠?



