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.4k stars 806 forks source link

不支持AndroidX? #344

Open fishsoft opened 4 years ago

fishsoft commented 4 years ago

Robust版本:如:0.4.88 Gradle版本:如:3.0.0 系统:Windows androidx下打包release apk出现一下异常: Could not get unknown property 'resourceFile' for task ':app:packageRelease' of type com.android.build.gradle.tasks.PackageApplication.

hedex commented 4 years ago

@fishsoft 可以提供一下更详细的Log堆栈吗?

kingiis commented 4 years ago

13:08:31: Executing task 'assembleRelease'...

Executing tasks: [assembleRelease] in project D:\lz_projects\hotfix\app

Configure project :app Register robust transform successful !!! Kotlin plugin should be enabled before 'kotlin-android-extensions'

Task :app:preBuild UP-TO-DATE Task :app:extractProguardFiles UP-TO-DATE Task :app:preReleaseBuild UP-TO-DATE Task :app:checkReleaseManifest UP-TO-DATE Task :app:generateReleaseBuildConfig UP-TO-DATE Task :app:compileReleaseAidl NO-SOURCE Task :app:compileReleaseRenderscript NO-SOURCE Task :app:mainApkListPersistenceRelease UP-TO-DATE Task :app:generateReleaseResValues UP-TO-DATE Task :app:generateReleaseResources UP-TO-DATE Task :app:mergeReleaseResources UP-TO-DATE Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE Task :app:processReleaseManifest UP-TO-DATE Task :app:processReleaseResources UP-TO-DATE Task :app:compileReleaseKotlin Task :app:mergeReleaseShaders UP-TO-DATE Task :app:compileReleaseShaders UP-TO-DATE Task :app:generateReleaseAssets UP-TO-DATE Task :app:mergeReleaseAssets UP-TO-DATE Task :app:validateSigningRelease UP-TO-DATE Task :app:signingConfigWriterRelease UP-TO-DATE Task :app:javaPreCompileRelease Task :app:compileReleaseJavaWithJavac UP-TO-DATE Task :app:compileReleaseSources UP-TO-DATE Task :app:mergeReleaseJniLibFolders UP-TO-DATE Task :app:mergeReleaseNativeLibs UP-TO-DATE Task :app:stripReleaseDebugSymbols UP-TO-DATE Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE Task :app:processReleaseJavaRes NO-SOURCE Task :app:mergeReleaseJavaResource UP-TO-DATE

Task :app:transformClassesWithRobustForRelease ================robust start================ read all class file cost 0.435 second check all class cost 0.715 second, class count: 2307

class name cn.kingiis.hotfix.BuildConfig should not be insert code class name cn.kingiis.hotfix.R$anim should not be insert code class name cn.kingiis.hotfix.R$attr should not be insert code class name cn.kingiis.hotfix.R$bool should not be insert code class name cn.kingiis.hotfix.R$color should not be insert code class name cn.kingiis.hotfix.R$dimen should not be insert code class name cn.kingiis.hotfix.R$drawable should not be insert code class name cn.kingiis.hotfix.R$id should not be insert code class name cn.kingiis.hotfix.R$integer should not be insert code class name cn.kingiis.hotfix.R$interpolator should not be insert code class name cn.kingiis.hotfix.R$layout should not be insert code class name cn.kingiis.hotfix.R$mipmap should not be insert code class name cn.kingiis.hotfix.R$string should not be insert code class name cn.kingiis.hotfix.R$style should not be insert code class name cn.kingiis.hotfix.R$styleable should not be insert code class name cn.kingiis.hotfix.R$styleable should not be insert code class name cn.kingiis.hotfix.R should not be insert code ctClass: cn.kingiis.hotfix.MainActivity error: javassist.CannotCompileException: [source error] isSupport(java.lang.Object[],java.lang.Object,com.meituan.robust.ChangeQuickRedirect,boolean,int) not found in com.meituan.robust.PatchProxy ctClass: cn.kingiis.hotfix.MainActivity error: javassist.CannotCompileException: [source error] isSupport(java.lang.Object[],java.lang.Object,com.meituan.robust.ChangeQuickRedirect,boolean,int) not found in com.meituan.robust.PatchProxy ctClass: cn.kingiis.hotfix.MainActivity error: javassist.CannotCompileException: [source error] isSupport(java.lang.Object[],java.lang.Object,com.meituan.robust.ChangeQuickRedirect,boolean,int) not found in com.meituan.robust.PatchProxy

Task :app:transformClassesWithRobustForRelease robust cost 3.731 second ================robust end================

Task :app:transformClassesAndResourcesWithR8ForRelease Task :app:packageRelease FAILED

FAILURE: Build failed with an exception.

BUILD FAILED in 32s 25 actionable tasks: 5 executed, 20 up-to-date 13:09:04: Task execution finished 'assembleRelease'.

kingiis commented 4 years ago

同AndroidX项目 debug就可以 release 就不行 混淆 true 带签名 这个也有 lintOptions { checkReleaseBuilds false abortOnError false } implementation 'com.meituan.robust:robust:0.4.91'

    classpath 'com.android.tools.build:gradle:3.5.3'
   classpath 'com.meituan.robust:gradle-plugin:0.3.3'
    classpath 'com.meituan.robust:auto-patch-plugin:0.3.3'
kingiis commented 4 years ago

classpath 'com.android.tools.build:gradle:3.5.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" //生成robustjar包插件 classpath 'com.meituan.robust:gradle-plugin:0.4.91' classpath 'com.meituan.robust:auto-patch-plugin:0.4.91'

implementation 'com.meituan.robust:robust:0.4.91'

切换到最新版本 ok了