- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用Android Studio 1.2.2,并尝试使用proguard设置生成APK。我也在我的应用程序中使用 joda-time-2.7.jar 。
这给我带来以下错误信息。
错误:任务':app:packageRelease'的执行失败。
Unable to compute hash of D:\Voice\app\build\intermediates\classes-proguard\release\classes.jar
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.xxxwew.voice"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile files('libs/joda-time-2.7.jar')
}
Warning:org.joda.time.DateMidnight: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Duration: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Instant: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MutableDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MutablePeriod: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Period: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractDuration: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractInstant: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractPeriod: can't find referenced class org.joda.convert.ToString
Warning:there were 37 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with '-dontwarn' options.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Exception while processing task java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:473)
at proguard.ProGuard.initialize(ProGuard.java:233)
at proguard.ProGuard.execute(ProGuard.java:98)
at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074)
at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139)
at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115)
at com.android.builder.tasks.Job.runTask(Job.java:48)
at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227)
at java.lang.Thread.run(Thread.java:745)
最佳答案
我找到了这个问题的答案。
应在保护文件中添加以下几行:
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *;}
关于android - 在某些类中使用JodaTime时,无法从Android Studio “Execution failed for task ':packageRelease'”生成签名的apk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36419156/
Error:A problem was found with the configuration of task ':app:packageRelease'. File '/Volumes/Data/
我不知道是什么问题,希望你能帮助我。 错误代码: Execution failed for task ':app:packageRelease'. java.io.IOException: Faile
我正在使用 Android Studio,但是当我通过“gradlew packageRelease”打包 App 时,zipalign 对我不起作用。我已经通过 jarsigner 验证签名是正确的
我正在使用Android Studio 1.2.2,并尝试使用proguard设置生成APK。我也在我的应用程序中使用 joda-time-2.7.jar 。 这给我带来以下错误信息。 错误:任务':
我正在使用 Cordova 5.1.1 为 Android 开发应用程序。我想创建一个签名 APK 以上传到 Google Play。 我通过在/Applications/rubystack/apac
我正在尝试在 Android Studio 中通过使用 Gradle 的项目在 Release模式下使用 Build Variant 测试应用。 build.gradle: (omitted depe
我正在使用 Android Studio 1.2.2 并尝试使用 proguard 设置生成 APK。但我不能这样做并收到以下错误消息。 “任务':packageRelease'执行失败。 Unabl
我正在尝试在 Android 应用上进行“发布”构建,但我不断收到以下错误: Unable to compute hash of /../AndroidStudioProjects/../classe
当我尝试构建发布版本时出现以下错误。我正在使用 android studio 2.3 。我在下面添加了我的 gradle 和 proguard 规则文件,我将在 mac os X 上使用 mac Er
任务执行失败:app:packageRelease com.android.ide.common.signing.KeytoolException: Failed to read key key0 f
我正在尝试使用 minifyEnabled true 编译我的 apk buildTypes { release { minifyEnabled true p
当我从 gradle 文件启用 Proguard 并生成发布构建文件时,我收到以下错误消息。 Exception while processing task java.io.IOException:
我是一名优秀的程序员,十分优秀!