每當我使用離子構建我的項目時,它會給我1000個警告。我嘗試了很多東西,在proguard-rules.pro
的變化,但他們似乎沒有任何工作。我不知道如何刪除這些警告。其中一些在下面。離子Android構建拋出警告
Maybe this is program method 'org.xwalk.core.internal.InMemorySharedPreferences$InMemoryEditor { void apply(); }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'icon' dynamically
Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { int icon; }'
Maybe this is program field 'android.support.v7.appcompat.R$attr { int icon; }'
Maybe this is program field 'android.support.v7.appcompat.R$id { int icon; }'
Maybe this is program field 'com.digits.sdk.android.R$attr { int icon; }'
Maybe this is program field 'com.digits.sdk.android.R$id { int icon; }'
Maybe this is program field 'com.facebook.android.R$attr { int icon; }'
Maybe this is program field 'com.facebook.android.R$id { int icon; }'
Maybe this is program field 'com.twitter.sdk.android.R$attr { int icon; }'
Maybe this is program field 'com.twitter.sdk.android.R$id { int icon; }'
Maybe this is program field 'dk.nodes.ncore.R$attr { int icon; }'
Maybe this is program field 'dk.nodes.ncore.R$id { int icon; }'
Maybe this is program field 'io.fabric.sdk.android.services.settings.AppRequestData { io.fabric.sdk.android.services.settings.IconRequest icon; }'
Maybe this is program field 'io.fabric.sdk.android.services.settings.AppSettingsData { io.fabric.sdk.android.services.settings.AppIconSettingsData icon; }'
Note: android.support.v4.app.NotificationCompatJellybean accesses a declared field 'title' dynamically
Maybe this is program field 'android.support.v4.app.NotificationCompat$Action { java.lang.CharSequence title; }'
Maybe this is program field 'android.support.v7.appcompat.R$attr { int title; }'
Maybe this is program field 'android.support.v7.appcompat.R$id { int title; }'
Maybe this is program field 'com.digits.sdk.android.R$attr { int title; }'
Maybe this is program field 'com.digits.sdk.android.R$id { int title; }'
Maybe this is program method 'com.google.android.gms.internal.zzso { com.google.android.gms.internal.zzsu clone(); }'
Maybe this is program method 'com.google.android.gms.internal.zzso { java.lang.Object clone(); }'
Maybe this is program method 'com.google.android.gms.internal.zzsq { java.lang.Object clone(); }'
Maybe this is program method 'com.google.android.gms.internal.zzsr { java.lang.Object clone(); }'
Maybe this is program method 'com.google.android.gms.internal.zzsu { com.google.android.gms.internal.zzsu clone(); }'
Maybe this is program method 'com.google.android.gms.internal.zzsu { java.lang.Object clone(); }'
Maybe this is program method 'com.google.gson.internal.Excluder { com.google.gson.internal.Excluder clone(); }'
Maybe this is program method 'com.google.gson.internal.Excluder { java.lang.Object clone(); }'
Maybe this is program method 'com.google.protobuf.AbstractMessage$Builder { com.google.protobuf.AbstractMessage$Builder clone(); }'
Maybe this is program method 'com.google.protobuf.AbstractMessage$Builder { com.google.protobuf.AbstractMessageLite$Builder clone(); }'
Maybe this is program method 'com.google.protobuf.AbstractMessage$Builder { com.google.protobuf.MessageLite$Builder clone(); }'
Maybe this is program method 'com.google.protobuf.AbstractMessage$Builder { java.lang.Object clone(); }'
Maybe this is program method 'com.google.protobuf.AbstractMessage$Builder { com.google.protobuf.Message$Builder clone(); }'
而且我的 'progaurd-rules.pro' 如下
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes Exceptions
-verbose
-dontoptimize
-dontpreverify
-dontnote **
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-keepclasseswithmembernames class * {
native <methods>;
}
-keepattributes EnclosingMethod
-keepattributes *Annotation*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.support.v4.app.Fragment
-keep public class * extends android.app.Fragment
-keep public class com.google.** {*; }
-keep public class com.facebook.** {*; }
-ignorewarnings
-dontwarn android.support.v7.**
-keep class android.support.v7.internal.** { *; }
-keep interface android.support.v7.internal.** { *; }
-keep class android.support.v7.** { *; }
-dontwarn android.support.v7.appcompat.** {*;}
-dontwarn com.squareup.okhttp.**
-keep interface android.support.v7.appcompat.** { *; }
-keep class android.support.v7.appcompat.** { *; }
-keep class com.facebook.** {
*;
}
-dontwarn org.apache.commons.lang3.time.**
-dontwarn dk.nodes.widgets.buttons.**
-dontwarn net.hockeyapp.android.tasks.**
-dontobfuscate
-dontpreverify
-dontnote android.support.v4.app.NotificationCompatJellybean
-dontwarn android.support.v4.app.NotificationCompatJellybean
-dontnote org.apache.commons.lang3.ObjectUtils
-dontwarn org.apache.commons.lang3.ObjectUtils
-dontnote com.google.protobuf.Descriptors$FileDescriptor
-dontwarn com.google.protobuf.Descriptors$FileDescriptor
-dontwarn class * extends com.google.protobuf.GeneratedMessageLite.** { *; }
-dontwarn interface * extends com.google.protobuf.GeneratedMessageLite.** { *; }
-dontnote com.google.protobuf.**
-dontnote com.google.android.**
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembers class **.R$* {
public static <fields>;
<fields>;
}
-libraryjars libs
#-injars libs/AudienceNetwork.jar
#-injars libs/google-api-client-1.18.0-rc.jar
#-injars libs/google-api-client-android-1.18.0-rc.jar
#-injars libs/google-http-client-android-1.18.0-rc.jar
# The official support library.
-keep class android.support.v4.** { *; }
-keepclassmembers class android.support.v4.** {
*;
}
-keep interface android.support.v4.** { *; }
-keep class android.support.v7.** { *; }
-keepclassmembers class android.support.v7.** {
*;
}
-keep interface android.support.v7.** { *; }
# Library JARs.
-keep class com.facebook.** {
*;
}
-keepclassmembers class com.facebook.** {
*;
}
當我建立在Android Studio中,我沒有得到警告。但在終端上,'離子狀態機構建'我得到警告,這也只是在'離子狀態重置'後第一次。這些警告是由於Notes顯示列表。
Reading library jar [/Users/neelavijayakumar/Library/Android/sdk/build-tools/23.0.2/lib/shrinkedAndroid.jar]
Note: android.support.v4.view.ViewPager calls 'Class.getAnnotation'
Note: com.facebook.model.GraphObject$Factory calls 'Method.getAnnotation'
Note: com.facebook.model.GraphObject$Factory$GraphObjectProxy calls 'Method.getAnnotation'
Note: com.google.ads.mediation.MediationServerParameters calls 'Field.getAnnotation'
Note: com.google.android.gms.internal.zzamp calls 'Field.getAnnotation'
Note: com.google.android.gms.internal.zzant calls 'Class.getAnnotation'
Note: com.google.android.gms.internal.zzant calls 'Field.getAnnotation'
Note: com.google.android.gms.internal.zzaoe calls 'Class.getAnnotation'
Note: com.google.android.gms.internal.zzaoj calls 'Field.getAnnotation'
Note: com.google.android.gms.internal.zzaon$zza calls 'Field.getAnnotation'
Note: com.google.gson.FieldAttributes calls 'Field.getAnnotation'
Note: com.google.gson.FieldAttributes calls 'Field.getAnnotations'
Note: com.google.gson.internal.Excluder calls 'Field.getAnnotation'
Note: com.google.gson.internal.Excluder calls 'Class.getAnnotation'
Note: com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory calls 'Class.getAnnotation'
Note: com.google.gson.internal.bind.ReflectiveTypeAdapterFactory calls 'Field.getAnnotation'
Note: com.google.gson.internal.bind.TypeAdapters$EnumTypeAdapter calls 'Field.getAnnotation'
Note: com.pushwoosh.internal.request.RequestManager$1 calls 'Class.getAnnotation'
Note: io.fabric.sdk.android.Fabric calls 'Class.getAnnotation'
Note: io.fabric.sdk.android.Kit calls 'Class.getAnnotation'
Note: org.xwalk.core.extension.JsStubGenerator calls 'Method.getParameterAnnotations'
Note: retrofit.RestMethodInfo calls 'Method.getAnnotations'
Note: retrofit.RestMethodInfo calls 'Class.getAnnotations'
Note: retrofit.RestMethodInfo calls 'Method.getParameterAnnotations'
Note: acidhax.cordova.chromecast.Chromecast calls 'Method.getGenericParameterTypes'
Note: android.support.v4.app.NotificationCompatJellybean calls 'Field.getType'
Note: com.digits.sdk.android.ActivityClassManagerFactory$ThemeAttributes calls 'Field.getType'
Note: com.digits.sdk.android.ThemeUtils calls 'Field.getType'
Note: com.facebook.model.GraphObject$Factory$GraphObjectProxy calls 'Method.getGenericReturnType'
Note: com.google.android.gms.internal.zzanr calls 'Class.getGenericInterfaces'
Note: com.google.android.gms.internal.zzanr calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzanr calls 'Class.getTypeParameters'
Note: com.google.android.gms.internal.zzant calls 'Field.getType'
Note: com.google.android.gms.internal.zzaoj calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzaoj calls 'Field.getGenericType'
Note: com.google.android.gms.internal.zzaoj calls 'Field.getType'
Note: com.google.android.gms.internal.zzaoo calls 'Class.getGenericSuperclass'
Note: com.google.android.gms.internal.zzapd calls 'Field.getType'
Note: com.google.gson.FieldAttributes calls 'Field.getGenericType'
Note: com.google.gson.FieldAttributes calls 'Field.getType'
這是第一次,有很多更新,從第二次,所有都是最新的,所以我沒有得到警告。這是對這個問題的詳細分析。此外,我忘了提及這些來自我在離子項目中使用的AAR庫。請幫助我。
嘗試離子平臺rm android,離子平臺添加andrid – Gopinath
是的,試過..沒有工作.. – Neela
@Neela歡迎回來。雖然我不是這方面的專家,但我猜想在proguard中設置-dontnote選項應該可以幫助你抑制警告。看看這些鏈接 - http://proguard.sourceforge.net/manual/usage.html#dontnote http://stackoverflow.com/questions/6068902/how-to-suppress-maybe-this-is-program-method- warnings-from-proguard讓我知道它是否有幫助 – Gandhi