với Android Studio: 1.2.RCAndroid-Studio-1.2.RC Proguard cảnh báo trên thư viện tham khảo Okio Square
tôi kích hoạt Proguard trong .gradle: `` `
minifyEnabled=true
and added these rules to my proguard-rules.pro:
-dontwarn com.squareup.**
-dontwarn okio.**
and added these lint rules to my .gradle file:
warningsAsErrors false
abortOnError false
disable 'InvalidPackage'
`` `
Nhưng tôi vẫn nhận được những cảnh báo khi tôi cố gắng để chạy các ứng dụng trong chế độ gỡ lỗi:
```
Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Files
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class java.nio.file.Path
Warning: okio.Okio: can't find referenced class java.nio.file.OpenOption
Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
Warning: there were 14 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)
:app:proguardDebug FAILED
` ``
Thật kỳ lạ kể từ khi tôi cũng bổ sung những quy tắc/tùy chọn cho tất cả các mô-đun thư viện của tôi phụ thuộc vào OkHttp/Picasso, tôi không biết đã xảy ra lỗi ở đâu, có lẽ đây là lỗi Android Studio? Có ai có bất kỳ manh mối nào cho vấn đề này không?
Tôi đã mở issue trên github.
Bạn có thể bỏ qua các cảnh báo này. https://github.com/square/okio/issues/60 –