java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: all loader classes don't appear in old primary dex.

GitHub | xufan | 5 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    gradle tinkerPatchDebug 调用出错

    GitHub | 5 months ago | xufan
    java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: all loader classes don't appear in old primary dex.
  2. 0

    com.tencent.tinker.build.util.TinkerPatchException: loader classes are found in old secondary dex.

    GitHub | 5 months ago | Drizzlezhang
    java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: loader classes are found in old secondary dex. Found classes: {Lcom/test/BaseApplication;}
  3. 0

    Warning:ignoreWarning is false, but we found some loader class has been changed in new dex. Such these changes will not take effect!!

    GitHub | 2 months ago | wyh497823256
    java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: some loader class has been changed in new dex. Such these changes will not take effect!! related classes: {Lcom/tencent/tinker/loader/shareutil/ShareResPatchInfo;,Lcom/tencent/tinker/loader/SystemClassLoaderAdder$V23;,Lcom/tencent/tinker/loader/shareutil/ShareBsDiffPatchInfo;,Lcom/tencent/tinker/loader/shareutil/SharePatchFileUtil;,Lcom/tencent/tinker/loader/shareutil/ShareFileLockHelper;,Lcom/tencent/tinker/loader/shareutil/ShareReflectUtil;,Lcom/tencent/tinker/loader/TinkerParallelDexOptimizer$ResultCallback;,Lcom/tencent/tinker/loader/TinkerParallelDexOptimizer;,Lcom/tencent/tinker/loader/TinkerDexLoader$1;,Lcom/tencent/tinker/loader/TinkerTestDexLoad;,Lcom/tencent/tinker/loader/TinkerSoLoader;,Lcom/tencent/tinker/loader/TinkerDexLoader;,Lcom/tencent/tinker/loader/TinkerResourcePatcher;,Lcom/tencent/tinker/loader/app/ApplicationLifeCycle;,Lcom/tencent/tinker/loader/shareutil/ShareTinkerInternals;,Lcom/tencent/tinker/loader/app/DefaultApplicationLike;,Lcom/tencent/tinker/loader/shareutil/ShareConstants;,Lcom/tencent/tinker/loader/AndroidNClassLoader;,Lcom/tencent/tinker/loader/shareutil/SharePatchInfo;,Lcom/tencent/tinker/loader/shareutil/ShareIntentUtil;,Lcom/tencent/tinker/loader/BuildConfig;,Lcom/tencent/tinker/loader/SystemClassLoaderAdder$V14;,Lcom/tencent/tinker/loader/TinkerLoader;,Lcom/tencent/tinker/loader/SystemClassLoaderAdder$V4;,Lcom/tencent/tinker/loader/app/ApplicationLike;,Lcom/tencent/tinker/loader/shareutil/ShareSecurityCheck;,Lcom/tencent/tinker/loader/AbstractTinkerLoader;,Ltinker/sample/android/app/SampleApplication;,Lcom/tencent/tinker/loader/app/TinkerApplication;,Lcom/tencent/tinker/loader/TinkerResourceLoader;,Lcom/tencent/tinker/loader/shareutil/ShareDexDiffPatchInfo;,Lcom/tencent/tinker/loader/SystemClassLoaderAdder$V19;,Lcom/tencent/tinker/loader/TinkerParallelDexOptimizer$OptimizeWorker;,Lcom/tencent/tinker/loader/SystemClassLoaderAdder;,Lcom/tencent/tinker/loader/shareutil/ShareResPatchInfo$LargeModeInfo;,Lcom/tencent/tinker/loader/TinkerRuntimeException;}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Release下打补丁

    GitHub | 5 months ago | l114624915
    java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: some loader class has been changed in new dex. Such these changes will not take effect!! related classes: {Lcom/tencent/tinker/loader/AndroidNClassLoader;,Lcom/tencent/tinker/loader/TinkerLoader;,Lcom/tencent/tinker/loader/TinkerResourceLoader;}
  6. 0

    删除sample项目的BaseBuildInfo类后报错

    GitHub | 3 months ago | jp1017
    java.lang.RuntimeException: com.tencent.tinker.build.util.TinkerPatchException: loader classes in old primary dex are mismatched to those in new primary dex, if deleted classes is not empty, check if your dex division strategy is fine. added classes: {} deleted classes: {Ltinker/sample/android/app/BaseBuildInfo;}

    Root Cause Analysis

    1. com.tencent.tinker.build.util.TinkerPatchException

      all loader classes don't appear in old primary dex.

      at com.tencent.tinker.build.util.ExcludedClassModifiedChecker.checkIfExcludedClassWasModifiedInNewDex()
    2. com.tencent.tinker
      ApkDecoder$ApkFilesVisitor.visitFile
      1. com.tencent.tinker.build.util.ExcludedClassModifiedChecker.checkIfExcludedClassWasModifiedInNewDex(ExcludedClassModifiedChecker.java:168)
      2. com.tencent.tinker.build.decoder.DexDiffDecoder.patch(DexDiffDecoder.java:117)
      3. com.tencent.tinker.build.decoder.UniqueDexDiffDecoder.patch(UniqueDexDiffDecoder.java:39)
      4. com.tencent.tinker.build.decoder.ApkDecoder$ApkFilesVisitor.visitFile(ApkDecoder.java:176)
      5. com.tencent.tinker.build.decoder.ApkDecoder$ApkFilesVisitor.visitFile(ApkDecoder.java:138)
      5 frames
    3. Java RT
      Files.walkFileTree
      1. java.nio.file.Files.walkFileTree(Files.java:2670)
      2. java.nio.file.Files.walkFileTree(Files.java:2742)
      2 frames
    4. com.tencent.tinker
      Runner$gradleRun.call
      1. com.tencent.tinker.build.decoder.ApkDecoder.patch(ApkDecoder.java:113)
      2. com.tencent.tinker.build.patch.Runner.tinkerPatch(Runner.java:65)
      3. com.tencent.tinker.build.patch.Runner.run(Runner.java:48)
      4. com.tencent.tinker.build.patch.Runner.gradleRun(Runner.java:41)
      5. com.tencent.tinker.build.patch.Runner$gradleRun.call(Unknown Source)
      5 frames
    5. Groovy
      AbstractCallSite.call
      1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      3 frames
    6. com.tencent.tinker
      TinkerPatchSchemaTask.tinkerPatch
      1. com.tencent.tinker.build.gradle.task.TinkerPatchSchemaTask.tinkerPatch(TinkerPatchSchemaTask.groovy:84)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    8. org.gradle.internal
      JavaMethod.invoke
      1. org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
      1 frame
    9. Gradle Core
      StoppableExecutorImpl$1.run
      1. org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:133)
      2. org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:126)
      3. org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:115)
      4. org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:623)
      5. org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:606)
      6. org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
      7. org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
      8. org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
      9. org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
      10. org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
      11. org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
      12. org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
      13. org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
      14. org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
      15. org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
      16. org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
      17. org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
      18. org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
      19. org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
      20. org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
      21. org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
      21 frames
    10. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames