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

打包补丁是报错 Caused by: java.lang.UnsupportedClassVersionError: com/meituan/robust/autopatch/NameManger : Unsupported major.minor version 52.0 #144

Closed ChunLinHuang closed 7 years ago

ChunLinHuang commented 7 years ago

异常类型:编译异常

手机型号:

手机系统版本:

Robust版本:0.3.8

Gradle版本:2.10

系统:windows

堆栈/日志:

ChunLinHuang commented 7 years ago

当前jdk版本1.7;1.8也试了也是包这个错

mivanzhang commented 7 years ago

我们刚刚解决这个问题,使用最新的0.4.2版本

GreenVegetables commented 7 years ago

使用的0.4.2,问题依然存在,打不成功 A problem occurred evaluating project ':app'.

java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

hedex commented 7 years ago

@GreenVegetables 在根目录的build.gradle 里面增加 classpath 'me.tatarka:gradle-retrolambda:3.2.0'

GreenVegetables commented 7 years ago

依然不行啊,大佬 `Microsoft Windows [版本 6.1.7601] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

D:\code\studioworkspace\RobustDemo>gradlew clean assembleRelease --stacktrace --no-daemon To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/3.3/userguide /gradle_daemon.html. Daemon will be stopped at the end of the build stopping after processing

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 14.965 secs `

mivanzhang commented 7 years ago

你把robust给关掉,看看项目能跑起来吗

GreenVegetables commented 7 years ago

可以的,主要就是这个开关apply plugin: 'auto-patch-plugin'一打开,然后就打不了补丁包 项目里就一个MainActivity `public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    findViewById(R.id.loadPatch).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            runRobust();
        }
    });

    findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
        @Modify
        @Override
        public void onClick(View v) {

// RobustModify.modify(); // Toast.makeText(MainActivity.this,"哈哈哈打",Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this,getString(),Toast.LENGTH_SHORT).show(); } });

}

private void runRobust() {
    new PatchExecutor(getApplicationContext(), new PatchManipulateImp(), new Callback()).start();
}

class Callback implements RobustCallBack {

    @Override
    public void onPatchListFetched(boolean result, boolean isNet, List<Patch> patches) {
        System.out.println(" robust arrived in onPatchListFetched");
    }

    @Override
    public void onPatchFetched(boolean result, boolean isNet, Patch patch) {
        System.out.println(" robust arrived in onPatchFetched");
    }

    @Override
    public void onPatchApplied(boolean result, Patch patch) {
        System.out.println(" robust arrived in onPatchApplied ");

    }

    @Override
    public void logNotify(String log, String where) {
        System.out.println(" robust arrived in logNotify " + where);
    }

    @Override
    public void exceptionNotify(Throwable throwable, String where) {
        throwable.printStackTrace();
        System.out.println(" robust arrived in exceptionNotify " + where);
    }
}

@Add
public String getString() {
    return "Robust";
}

} `

mivanzhang commented 7 years ago

把你的demo放到github上,我看看

GreenVegetables commented 7 years ago

@mivanzhang https://github.com/GreenVegetables/RobustDemo

mivanzhang commented 7 years ago

@GreenVegetables 我下载你的demo运行正常呀,你的本机的AS环境是不是支持了Java 8? image

GreenVegetables commented 7 years ago

@mivanzhang 成功了,是本地环境原因,谢谢大佬::>_<::