0
我嘗試了Google中的所有選項,但沒有任何幫助。 關於Gradle 1.3版本的項目打算,但是當所有在裝配過程中的2,2,3發佈版本錯誤。錯誤:java.lang.RuntimeException:proguard - release(app:transformClassesAndResourcesWithProguardForRelease)
錯誤時proguard的啓用:
Error:java.lang.NullPointerException
Warning:The interface com/github/tibolte/agendacalendarview/agenda/IAgendaHeaderView has a static method "inflate" but backporting default methods is not enabled
Warning:Exception while processing task java.io.IOException: java.lang.NullPointerException
Error:java.lang.RuntimeException: Job failed, see logs for details
Error:java.io.IOException: java.lang.NullPointerException
搖籃:
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
signingConfigs {
releaseConfig {
storeFile file("test.jks")
storePassword "test"
keyAlias "test"
keyPassword "test"
}
}
defaultConfig {
applicationId "by.test.by"
minSdkVersion 15
targetSdkVersion 25
// versionCode 1
versionName project.props.version
multiDexEnabled true
}
lintOptions {
abortOnError false
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releaseConfig
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
// incremental false
javaMaxHeapSize "2048m"
preDexLibraries = false
Proguard的規則:
-dontwarn by.mrsoft.mrdoc.**
-dontwarn com.radaee.**
-dontwarn okio.**
-dontwarn org.joda.time.**
-adaptresourcefilenames
-adaptresourcefilecontents
-keepdirectories
-keep class android.support.v7.** { *; }
-keep class android.support.graphics.drawable.** { *; }
-assumenosideeffects class * {
@by.mrsoft.mrdoc.model.System.OnlyDebug *;
}
-keep class org.kxml2.** { *; }
-keep class org.acra.** { *; }
# исключение Radaee
-keep class com.radaee.** { *; }
#-keep class by.mrsoft.mrdoc.** { *; }
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
-keep class com.feitian.** { *; }
-keep class org.pkcs11.** { *; }
-keep class ru.aladdin.** { *; }
-keep class by.mrsoft.mrdoc.Eds.** { *; }
#-keep class java.awt.** { *; }
#-keep class javax.naming.** { *; }
#-keep class org.spongycastle.** { *; }
#-libraryjars <java.home>/lib/rt.jar
-dontwarn java.awt.**
-dontwarn javax.naming.**
-keep class com.sun.** { *; }
-keep class ru.rutoken.** { *; }
-keep class ru.CryptoPro.** { *; }
-keep class javax.** { *; }
-keep class com.intellij.** { *; }
-keep class org.apache.** { *; }
-dontwarn ru.CryptoPro.**
-optimizationpasses 1
#-optimizations !code/allocation/variable,
-dontwarn org.apache.**
-keep class org.apache.** { *; }
-keepclasseswithmembernames class * {
native <methods>;
}
-keep class android.support.design.widget.** { *; }
-keep interface android.support.design.widget.** { *; }
-dontwarn android.support.design.**
錯誤gradle這個:
失敗:建立失敗,一個異常。
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
> Job failed, see logs for details
* Try:
Run with --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.RuntimeException: Job failed, see logs for details
at com.android.build.gradle.internal.transforms.ProGuardTransform.transform(ProGuardTransform.java:196)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 14 more
Caused by: java.io.IOException: java.lang.NullPointerException
at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:283)
at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:63)
at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:173)
at com.android.builder.tasks.Job.runTask(Job.java:49)
at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:223)
Caused by: java.lang.NullPointerException
at proguard.util.FixedStringMatcher.matches(FixedStringMatcher.java:52)
at proguard.util.OrMatcher.matches(OrMatcher.java:46)
at proguard.classfile.util.WarningPrinter.accepts(WarningPrinter.java:89)
at proguard.classfile.util.WarningPrinter.print(WarningPrinter.java:77)
at proguard.AssumeNoSideEffectsChecker.checkClassSpecifications(AssumeNoSideEffectsChecker.java:86)
at proguard.ConfigurationChecker.check(ConfigurationChecker.java:141)
at proguard.ProGuard.execute(ProGuard.java:73)
at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:54)
at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:254)
... 5 more
沒有幫助,錯誤 '錯誤:顯示java.lang.NullPointerException 錯誤:java.io.IOException異常:顯示java.lang.NullPointerException 錯誤:java.lang.RuntimeException:作業失敗,請參閱日誌以獲取詳細信息 警告:處理任務時出現異常java.io.IOException:java.lang.NullPointerException 警告:com/github/tibolte/agendacalendarview/agenda/IAgendaHeaderView接口具有一個靜態方法「膨脹」,但不支持反向移植默認方法「 –
使用Java 8進行編譯可能會導致問題,因爲它的網絡她完全支持,也不向後兼容。嘗試通過這個,看看是否一切正常.https://developer.android.com/guide/platform/j8-jack.html –
@ Suhayl SH 您的答案作爲理事會沒有幫助 –