我试图在eclipse中导出我的项目的签名apk,但每次我创建一个密钥库并且我想导出它时我面临这个错误:
Proguard returned with error code 1. See console
这是我的日志:
[2017-01-06 13:40:30 - IPTVPlayer] Dx
trouble writing output: already prepared
[2017-01-06 13:40:30 - IPTVPlayer] ------------------------------
[2017-01-06 13:40:30 - IPTVPlayer] Android Launch!
[2017-01-06 13:40:30 - IPTVPlayer] adb is running normally.
[2017-01-06 13:40:30 - IPTVPlayer] Performing com.simple.iptv.player.Player activity launch
[2017-01-06 13:40:30 - IPTVPlayer] Automatic Target Mode: using device 'VS9804G11989257'
[2017-01-06 13:40:30 - IPTVPlayer] Uploading IPTVPlayer.apk onto device 'VS9804G11989257'
[2017-01-06 13:40:31 - IPTVPlayer] Installing IPTVPlayer.apk...
[2017-01-06 13:40:35 - IPTVPlayer] Success!
[2017-01-06 13:40:36 - IPTVPlayer] Starting activity com.simple.iptv.player.Player on device VS9804G11989257
[2017-01-06 13:40:36 - IPTVPlayer] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.simple.iptv.player/.Player }
[2017-01-06 13:41:18 - IPTVPlayer] New keystore C:\Users\Bahae Eddine\Desktop\Final Application\apk\IPTVPlayer-Final.apk has been created.
[2017-01-06 13:41:18 - IPTVPlayer] Certificate fingerprints:
[2017-01-06 13:41:18 - IPTVPlayer] MD5 : 73:B4:6D:5E:D1:59:FA:EB:34:8D:2F:F7:19:C7:4D:88
[2017-01-06 13:41:18 - IPTVPlayer] SHA1: 92:7B:11:C3:1C:3B:67:00:BD:2A:5F:DC:7E:EE:BE:7E:25:4E:E8:64
[2017-01-06 13:41:20 - IPTVPlayer] Proguard returned with error code 1. See console
[2017-01-06 13:41:20 - IPTVPlayer] Error: Can't read [C:\Program Files\Java\jre1.8.0_111\lib\rt.jar] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
这是我的proguard-project.txt我添加了一些行:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keep class android.support.v4.** { *; }
-dontwarn android.support.v4.**
-dontwarn javax.activation.**
-dontwarn javax.security.**
-dontwarn java.awt.**
-libraryjars <java.home>/lib/rt.jar
-keep class javax.** {*;}
-keep class com.sun.** {*;}
-keep class myjava.** {*;}
-keep class org.apache.harmony.** {*;}
-keep public class Mail {*;}
-dontshrink
这是我的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-20
proguard.config=proguard-project.txt
android.library.reference.1=../google-play-services_lib
答案 0 :(得分:0)
错误消息全部说明:(Unsupported class version number [52.0] (maximum 51.0, Java 1.7)))
=&GT;您正在使用Java 8,但Proguard仅支持Java 7.因此,您必须使用Java 7或将项目的编译目标版本更改为Java 7(1.7)。
无论如何,你应该切换到AndroidStudio,因为不再支持Eclipse中的Android开发。