Meituan-Dianping / Robust

Robust is an Android HotFix solution with high compatibility and high stability. Robust can fix bugs immediately without a reboot.
Apache License 2.0
4.42k stars 807 forks source link

打补丁异常 #250

Open liuhuan8986 opened 6 years ago

liuhuan8986 commented 6 years ago

异常类型:编译异常 打补丁包异常

手机型号:

手机系统版本:

Robust版本:0.4.75

Gradle版本::3.3

系统:win7

android studio : 2.3.3

备注:我没有使用混淆的

堆栈/日志:

================autoPatch start================ autopatch read all class file cost 0.111 second check all class cost 0.3 second, class count: 1612 addPatchMethodAndModifiedClass pint methodmap key is lh.robustdemo.MainActivity$1.onClick(android.view.View) value is 1 key is lh.robustdemo.MainActivity$2.onClick(android.view.View) value is 2 key is lh.robustdemo.MainActivity.onCreate(android.os.Bundle) value is 3 key is lh.robustdemo.RobustCallBackSample.exceptionNotify(java.lang.Throwable,java.lang.String) value is 9 key is lh.robustdemo.RobustCallBackSample.onPatchFetched(boolean,boolean,com.meituan.robust.Patch) value is 6 key is lh.robustdemo.RobustCallBackSample.onPatchApplied(boolean,com.meituan.robust.Patch) value is 7 key is lh.robustdemo.RobustCallBackSample.logNotify(java.lang.String,java.lang.String) value is 8 key is lh.robustdemo.SecondActivity.onCreate(android.os.Bundle) value is 10 key is lh.robustdemo.PatchManipulateImp.fetchPatchList(android.content.Context) value is 4 key is lh.robustdemo.RobustCallBackSample.onPatchListFetched(boolean,boolean,java.util.List) value is 5

:app:transformClassesWithAutoPatchTransformForRelease FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

下面是我修改后的代码: package lh.robustdemo;

import android.util.Log;

import com.meituan.robust.patch.RobustModify; import com.meituan.robust.patch.annotaion.Add; import com.meituan.robust.patch.annotaion.Modify;

public class Info {

@Modify
public String getInfo(){
    add();
    Log.i("xxxx","xx");
    //return "这里是线上代码";
    return "这里是补丁代码";
}

@Add
public String add(){
    return "xxxx";
}

}

Caused by: org.codehaus.groovy.GroovyException: patch method lh.robustdemo.Info.getInfo() haven't insert code by Robust.Cannot patch this method, method.signature ()Ljava/lang/String 主要是这个问题吧,但是我robust.xml 有配置呀,

patchPackname,和hotfixPackage 都是这个包名 --> lh.robustdemo

我这个demo就只有一个包名的

liping12345 commented 5 years ago

同样的问题 请问解决了 么

ikkyu0319 commented 3 years ago

同样的问题 请问解决了 么. +1

MrYeLiang commented 6 months ago

确认下你的签名,不行你就重新生成个签名试试,我被这个问题困扰了半天,最后确认是签名的问题,复用了其他app的签名会报错