2017-03-28 7 views
2

APK、iTextのとProGuardの競合をコンパイルすることはできません:ビルド)は、私は今、私は、この手順に従うこれを行うには、APKを構築する必要があり、Androidアプリケーションを開発してい

1 - >クリーン

2 )ビルド - >生成APK

3)ジャー署名または完全APKの署名

を締結しかし、アプリケーションの生成は、エラーが発生している間:

Information:Gradle tasks [:app:assembleRelease] 
Warning:com.itextpdf.text.pdf.PdfEncryptor: can't find referenced class org.spongycastle.cms.jcajce.JceKeyTransEnvelopedRecipient 
Warning:com.itextpdf.text.pdf.PdfEncryptor: can't find referenced class org.spongycastle.cms.RecipientInformation 
Warning:com.itextpdf.text.pdf.PdfEncryptor: can't find referenced class org.spongycastle.cms.CMSException 
Warning:com.itextpdf.text.pdf.PdfEncryptor: can't find referenced class org.spongycastle.cms.RecipientInformation 
Warning:com.itextpdf.text.pdf.PdfEncryptor: can't find referenced class org.spongycastle.cms.Recipient 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.DEROutputStream 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.ASN1InputStream 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.DEROctetString 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.DERSet 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.cms.RecipientInfo 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.DERSet 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.x509.AlgorithmIdentifier 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.ASN1ObjectIdentifier 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.x509.AlgorithmIdentifier 
Warning:com.itextpdf.text.pdf.PdfPublicKeySecurityHandler: can't find referenced class org.spongycastle.asn1.cms.EncryptedContentInfo 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.tsp.MessageImprint 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1Sequence 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.cert.ocsp.BasicOCSPResp 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.cert.ocsp.SingleResp 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.cert.ocsp.CertificateID 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.operator.DigestCalculator 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.cert.ocsp.CertificateID 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1Sequence 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1TaggedObject 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1Sequence 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1OctetString 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ASN1InputStream 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.asn1.ocsp.BasicOCSPResponse 
Warning:com.itextpdf.text.pdf.security.PdfPKCS7: can't find referenced class org.spongycastle.tsp.TimeStampToken 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SigPolicyQualifierInfo 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.DERIA5String 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SigPolicyQualifierInfo 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SigPolicyQualifiers 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SignaturePolicyIdentifier 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SignaturePolicyId 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.DERObjectIdentifier 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.OtherHashAlgAndValue 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.x509.AlgorithmIdentifier 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.DEROctetString 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.OtherHashAlgAndValue 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SignaturePolicyId 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SignaturePolicyIdentifier 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SignaturePolicyIdentifier 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SigPolicyQualifierInfo 
Warning:com.itextpdf.text.pdf.security.SignaturePolicyInfo: can't find referenced class org.spongycastle.asn1.esf.SigPolicyQualifiers 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequestGenerator 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.asn1.ASN1ObjectIdentifier 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequestGenerator 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequest 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampResponse 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.asn1.cmp.PKIFailureInfo 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampResponse 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampToken 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampTokenInfo 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TSPException 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequest 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.asn1.cmp.PKIFailureInfo 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampToken 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampTokenInfo 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequestGenerator 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampRequest 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampResponse 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.asn1.cmp.PKIFailureInfo 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampToken 
Warning:com.itextpdf.text.pdf.security.TSAClientBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampTokenInfo 
Warning:com.itextpdf.text.pdf.security.TSAInfoBouncyCastle: can't find referenced class org.spongycastle.tsp.TimeStampTokenInfo 
Warning:org.joda.convert.AbstractTypeStringConverter: can't find referenced class com.google.common.collect.ImmutableMap 
Warning:org.joda.convert.AbstractTypeStringConverter: can't find referenced class com.google.common.collect.ImmutableMap$Builder 
Warning:org.joda.convert.AbstractTypeStringConverter: can't find referenced class com.google.common.collect.ImmutableMap 
Warning:org.joda.convert.AbstractTypeStringConverter: can't find referenced class com.google.common.collect.ImmutableMap$Builder 
Warning:org.joda.convert.AbstractTypeStringConverter: can't find referenced class com.google.common.collect.ImmutableMap 
Warning:org.joda.convert.TypeStringConverter: can't find referenced class com.google.common.reflect.TypeToken 
Warning:org.joda.convert.TypeTokenStringConverter: can't find referenced class com.google.common.reflect.TypeToken 
Warning:there were 823 unresolved references to classes or interfaces. 
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first. 
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. 
> Job failed, see logs for details 
Information:BUILD FAILED 

この問題の解決方法はわかりません。

私は何を試しましたか?

私はproguard-androidファイル(\ AppData \ Local \ Android \ sdk \ tools \ proguardにあります)にこのコードを入れました。

Rif

-keep class org.spongycastle.** { *; } 
-dontwarn org.spongycastle.** 

このソリューションは、私のために動作しません、問題は同じ

****現在のソリューションまま****

実際には唯一の解決策という私はこの値をグラデルで設定しました:

1)shrinkResources false

2)のGradleでこれを置くために偽

+0

アプリケーションを小型化するために「Proguard」を使用する場合は、無効にしているため、ソリューションが正しくありません。しかしそれ以外の場合は正しいです。 – Skillson

答えて

2

あなたがiTextのすべてのクラスを維持する場合は、何であるProGuardの-ルールで

-keep class com.itextpdf.** { *; } 
-dontwarn com.itextpdf.** 
2

てみminifyEnabled:

android{ 
... 
dexOptions { 
    jumboMode true 
} 
... 
} 
+0

実際に私が見つけた唯一の解決策は以下の通りです:1)shrinkResources false 2)minifyEnabled false – Max

1

これを配置しようとしますProguardの使用?
注意深く見ると、すべての警告にcom.itextpdf.text.pdfパッケージが含まれていることがわかります。また、org.joda.convert

-keep class com.itextpdf.text.pdf.** {*;} 
-dontwarn com.itextpdf.text.pdf.** 
-keep class org.joda.convert.** {*;} 
-dont warn org.joda.convert.** 
関連する問題