请问下,生成补丁的时候,提示如下,要肿么办。我照着demo看了好几遍了,不知道哪里搞错了。
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html.
Register robust transform successful !!!
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2421Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareComMeituanRobustRobust030Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:mergeReleaseShaders
:app:compileReleaseShaders
:app:generateReleaseAssets
:app:mergeReleaseAssets
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseManifest
:app:processReleaseResources
:app:generateReleaseSources
:app:incrementalReleaseJavaCompilationSafeguard
:app:compileReleaseJavaWithJavac
:app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:lintVitalRelease
:app:prePackageMarkerForRelease
:app:transformClassesWithAutoPatchTransformForRelease
================autoPatch start================
autopatch read all class file cost 0.09 second
check all class cost 0.229 second, class count: 2350
something wrong when readAnnotation, cannot find android\support\design\R$anim: android.support.design.R$anim found in android\support\design\R$anim.class cannot find class name android\support\design\R$anim
something wrong when readAnnotation, cannot find android\support\design\R$attr: android.support.design.R$attr found in android\support\design\R$attr.class cannot find class name android\support\design\R$attr
something wrong when readAnnotation, cannot find android\support\design\R$bool: android.support.design.R$bool found in android\support\design\R$bool.class cannot find class name android\support\design\R$bool
something wrong when readAnnotation, cannot find android\support\design\R$color: android.support.design.R$color found in android\support\design\R$color.class cannot find class name android\support\design\R$color
something wrong when readAnnotation, cannot find android\support\design\R$dimen: android.support.design.R$dimen found in android\support\design\R$dimen.class cannot find class name android\support\design\R$dimen
something wrong when readAnnotation, cannot find android\support\design\R$drawable: android.support.design.R$drawable found in android\support\design\R$drawable.class cannot find class name android\support\design\R$drawable
something wrong when readAnnotation, cannot find android\support\design\R$id: android.support.design.R$id found in android\support\design\R$id.class cannot find class name android\support\design\R$id
something wrong when readAnnotation, cannot find android\support\design\R$integer: android.support.design.R$integer found in android\support\design\R$integer.class cannot find class name android\support\design\R$integer
something wrong when readAnnotation, cannot find android\support\design\R$layout: android.support.design.R$layout found in android\support\design\R$layout.class cannot find class name android\support\design\R$layout
something wrong when readAnnotation, cannot find android\support\design\R$string: android.support.design.R$string found in android\support\design\R$string.class cannot find class name android\support\design\R$string
something wrong when readAnnotation, cannot find android\support\design\R$style: android.support.design.R$style found in android\support\design\R$style.class cannot find class name android\support\design\R$style
something wrong when readAnnotation, cannot find android\support\design\R$styleable: android.support.design.R$styleable found in android\support\design\R$styleable.class cannot find class name android\support\design\R$styleable
something wrong when readAnnotation, cannot find android\support\design\R: android.support.design.R found in android\support\design\R.class cannot find class name android\support\design\R
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$anim: android.support.v7.appcompat.R$anim found in android\support\v7\appcompat\R$anim.class cannot find class name android\support\v7\appcompat\R$anim
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$attr: android.support.v7.appcompat.R$attr found in android\support\v7\appcompat\R$attr.class cannot find class name android\support\v7\appcompat\R$attr
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$bool: android.support.v7.appcompat.R$bool found in android\support\v7\appcompat\R$bool.class cannot find class name android\support\v7\appcompat\R$bool
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$color: android.support.v7.appcompat.R$color found in android\support\v7\appcompat\R$color.class cannot find class name android\support\v7\appcompat\R$color
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$dimen: android.support.v7.appcompat.R$dimen found in android\support\v7\appcompat\R$dimen.class cannot find class name android\support\v7\appcompat\R$dimen
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$drawable: android.support.v7.appcompat.R$drawable found in android\support\v7\appcompat\R$drawable.class cannot find class name android\support\v7\appcompat\R$drawable
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$id: android.support.v7.appcompat.R$id found in android\support\v7\appcompat\R$id.class cannot find class name android\support\v7\appcompat\R$id
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$integer: android.support.v7.appcompat.R$integer found in android\support\v7\appcompat\R$integer.class cannot find class name android\support\v7\appcompat\R$integer
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$layout: android.support.v7.appcompat.R$layout found in android\support\v7\appcompat\R$layout.class cannot find class name android\support\v7\appcompat\R$layout
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$string: android.support.v7.appcompat.R$string found in android\support\v7\appcompat\R$string.class cannot find class name android\support\v7\appcompat\R$string
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$style: android.support.v7.appcompat.R$style found in android\support\v7\appcompat\R$style.class cannot find class name android\support\v7\appcompat\R$style
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R$styleable: android.support.v7.appcompat.R$styleable found in android\support\v7\appcompat\R$styleable.class cannot find class name android\support\v7\appcompat\R$styleable
something wrong when readAnnotation, cannot find android\support\v7\appcompat\R: android.support.v7.appcompat.R found in android\support\v7\appcompat\R.class cannot find class name android\support\v7\appcompat\R
something wrong when readAnnotation, cannot find android\support\v7\recyclerview\R$attr: android.support.v7.recyclerview.R$attr found in android\support\v7\recyclerview\R$attr.class cannot find class name android\support\v7\recyclerview\R$attr
something wrong when readAnnotation, cannot find android\support\v7\recyclerview\R$dimen: android.support.v7.recyclerview.R$dimen found in android\support\v7\recyclerview\R$dimen.class cannot find class name android\support\v7\recyclerview\R$dimen
something wrong when readAnnotation, cannot find android\support\v7\recyclerview\R$id: android.support.v7.recyclerview.R$id found in android\support\v7\recyclerview\R$id.class cannot find class name android\support\v7\recyclerview\R$id
something wrong when readAnnotation, cannot find android\support\v7\recyclerview\R$styleable: android.support.v7.recyclerview.R$styleable found in android\support\v7\recyclerview\R$styleable.class cannot find class name android\support\v7\recyclerview\R$styleable
something wrong when readAnnotation, cannot find android\support\v7\recyclerview\R: android.support.v7.recyclerview.R found in android\support\v7\recyclerview\R.class cannot find class name android\support\v7\recyclerview\R
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\BuildConfig: com.nanyi545.www.testrobust.BuildConfig found in com\nanyi545\www\testrobust\BuildConfig.class cannot find class name com\nanyi545\www\testrobust\BuildConfig
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\MainActivity: com.nanyi545.www.testrobust.MainActivity found in com\nanyi545\www\testrobust\MainActivity.class cannot find class name com\nanyi545\www\testrobust\MainActivity
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$anim: com.nanyi545.www.testrobust.R$anim found in com\nanyi545\www\testrobust\R$anim.class cannot find class name com\nanyi545\www\testrobust\R$anim
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$attr: com.nanyi545.www.testrobust.R$attr found in com\nanyi545\www\testrobust\R$attr.class cannot find class name com\nanyi545\www\testrobust\R$attr
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$bool: com.nanyi545.www.testrobust.R$bool found in com\nanyi545\www\testrobust\R$bool.class cannot find class name com\nanyi545\www\testrobust\R$bool
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$color: com.nanyi545.www.testrobust.R$color found in com\nanyi545\www\testrobust\R$color.class cannot find class name com\nanyi545\www\testrobust\R$color
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$dimen: com.nanyi545.www.testrobust.R$dimen found in com\nanyi545\www\testrobust\R$dimen.class cannot find class name com\nanyi545\www\testrobust\R$dimen
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$drawable: com.nanyi545.www.testrobust.R$drawable found in com\nanyi545\www\testrobust\R$drawable.class cannot find class name com\nanyi545\www\testrobust\R$drawable
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$id: com.nanyi545.www.testrobust.R$id found in com\nanyi545\www\testrobust\R$id.class cannot find class name com\nanyi545\www\testrobust\R$id
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$integer: com.nanyi545.www.testrobust.R$integer found in com\nanyi545\www\testrobust\R$integer.class cannot find class name com\nanyi545\www\testrobust\R$integer
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$layout: com.nanyi545.www.testrobust.R$layout found in com\nanyi545\www\testrobust\R$layout.class cannot find class name com\nanyi545\www\testrobust\R$layout
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$mipmap: com.nanyi545.www.testrobust.R$mipmap found in com\nanyi545\www\testrobust\R$mipmap.class cannot find class name com\nanyi545\www\testrobust\R$mipmap
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$string: com.nanyi545.www.testrobust.R$string found in com\nanyi545\www\testrobust\R$string.class cannot find class name com\nanyi545\www\testrobust\R$string
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$style: com.nanyi545.www.testrobust.R$style found in com\nanyi545\www\testrobust\R$style.class cannot find class name com\nanyi545\www\testrobust\R$style
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R$styleable: com.nanyi545.www.testrobust.R$styleable found in com\nanyi545\www\testrobust\R$styleable.class cannot find class name com\nanyi545\www\testrobust\R$styleable
something wrong when readAnnotation, cannot find com\nanyi545\www\testrobust\R: com.nanyi545.www.testrobust.R found in com\nanyi545\www\testrobust\R.class cannot find class name com\nanyi545\www\testrobust\R
new add methods list is
new add classes list is
patchMethodSignureSet is printed below
:app:transformClassesWithAutoPatchTransformForRelease FAILED
BUILD FAILED
Total time: 16.404 secs
---------------------代码---------------------
生成补丁之前 :
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
生成补丁的时候
@modify
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Object a=new Object();
Log.i("sss","--patching--:"+a);
}
------------proguard 和demo一样-------------------------
-keep class meituan.robust.patch.**{*;}
-keep class com.google.gson.{*;}
-keep class com.meituan.robust.{*;}
-dontwarn
-keepattributes Signature,SourceFile,LineNumberTable
-keepattributes Annotation
-keeppackagenames
-ignorewarnings
-dontwarn android.support.v4.**,CompatHoneycomb,com.tenpay.android.
-optimizations !class/unboxing/enum,!code/simplification/arithmetic
------------------- gradle 2.1 + buildToolsVersion "24.0.2"+ AS 2.3 ------------------------
--------------------gradle 补丁也放在第二个了-------------------------
apply plugin: 'com.android.application'
apply plugin: 'auto-patch-plugin'
apply plugin: 'robust'
-----------------------robust.xml和demo一样 只是修改了hotfixPackage为自己的包名。 -----------------------
<switch>
<!--true代表打开Robust,这个会比较耗时建议release包在打开-->
<turnOnRobust>true</turnOnRobust>
<!--<turnOnRobust>false</turnOnRobust>-->
<!--是否开启手动模式,手动模式会去寻找配置项patchPackname包名下的所有类,自动的处理混淆,然后把patchPackname包名下的所有类制作成补丁-->
<!--<manual>true</manual>-->
<manual>false</manual>
<!--是否强制插入插入代码,Robust默认在debug模式下是关闭的,开启这个选项为true会在debug下插入代码-->
<!--<forceInsert>true</forceInsert>-->
<forceInsert>false</forceInsert>
<!--是否捕获补丁中所有反射的异常,建议上线的时候这个开关的值为true,测试的时候为false-->
<catchReflectException>true</catchReflectException>
<!--<catchReflectException>false</catchReflectException>-->
<!--是否在补丁加上log,建议上线的时候这个开关的值为false,测试的时候为true-->
<!--<patchLog>true</patchLog>-->
<patchLog>false</patchLog>
</switch>
<!--需要热补的包名或者类名,这些包名下的所有类都被会插入代码-->
<packname name="hotfixPackage">
<name>com.nanyi545.www.testrobust</name>
</packname>
<!--不需要热补的包名或者类名,可以在需要热补的包中剔除指定的类或者包-->
<exceptPackname name="exceptPackage">
<name>com.meituan.robust</name>
</exceptPackname>
<!--补丁的包名-->
<patchPackname name="patchPackname">
<name>com.meituan.robust.patch</name>
</patchPackname>
<!--自动化补丁中,不需要反射处理的类,这个配置项慎重选择-->
<noNeedReflectClass name="classes no need to reflect">
</noNeedReflectClass>
手动模式为false情况下 patchPackname 是不是不用管。。应该没有影响吧。。