getsentry / sentry-android-gradle-plugin

Gradle plugin for Sentry Android. Upload proguard, debug files, and more.
https://docs.sentry.io/platforms/android/gradle/
MIT License
141 stars 32 forks source link

Sentry and Tinker Compilation conflicts #567

Closed mstains closed 11 months ago

mstains commented 11 months ago

Gradle Version

7.5

AGP Version

7.4

Code Minifier/Optimizer

R8

Version

3.8.0

Sentry SDK Version

6.28.0

Steps to Reproduce

1.The release package was compiled successfully.

2.Compiling the tinker service pack failed

Expected Result

successfully

Actual Result

FATAL: method 'uncaughtException:VLL' in loader class 'Lcom/tencent/tinker/loader/TinkerUncaughtHandler;' refers to class 'Lio/sentry/instrumentation/file/SentryFileWriter;' which is not loader class, this may cause crash when patch is loaded. FATAL: method 'uncaughtException:VLL' in loader class 'Lcom/tencent/tinker/loader/TinkerUncaughtHandler;' refers to method ':VLZ' in class 'Lio/sentry/instrumentation/file/SentryFileWriter;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'getFileTypeByMagic:IL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareElfFile;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'checkTinkerLastUncaughtCrash:LL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchFileUtil;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'copyFileUsingStream:VLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchFileUtil;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'copyFileUsingStream:VLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchFileUtil;' refers to method 'create:LLLZ' in class 'Lio/sentry/instrumentation/file/SentryFileOutputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'getMD5:LL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchFileUtil;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'readAndCheckProperty:LL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchInfo;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'rewritePatchInfoFile:ZLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/SharePatchInfo;' refers to method 'create:LLLZ' in class 'Lio/sentry/instrumentation/file/SentryFileOutputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'getProcessNameInternal:LL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerInternals;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'getSafeModeCount:IL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerInternals;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileInputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'setSafeModeCount:VLI' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerInternals;' refers to method 'create:LLL' in class 'Lio/sentry/instrumentation/file/SentryFileOutputStream$Factory;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method ':V' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerLog;' refers to method 'e:ILLL' in class 'Lio/sentry/android/core/SentryLogcatAdapter;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'e:VLLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerLog$1;' refers to method 'e:ILL' in class 'Lio/sentry/android/core/SentryLogcatAdapter;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'printErrStackTrace:VLLLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerLog$1;' refers to method 'e:ILL' in class 'Lio/sentry/android/core/SentryLogcatAdapter;' which is not in loader class, this may cause crash when patch is loaded. FATAL: method 'w:VLLL' in loader class 'Lcom/tencent/tinker/loader/shareutil/ShareTinkerLog$1;' refers to method 'w:ILL' in class 'Lio/sentry/android/core/SentryLogcatAdapter;' which is not in loader class, this may cause crash when patch is loaded.

romtsn commented 11 months ago

Hi, I have no idea what is Tinker, but you can disable our auto-instrumentation via

sentry {
  tracingInstrumentation {
    enabled.set(false)
  }
}

This should prevent the classes that are loaded at runtime to be instrumented. Would that help?

stefanosiano commented 11 months ago

Hi @mstains did disabling our auto-instrumentation work for you?

mstains commented 11 months ago

Yes, I solved this problem, thanks for the answer!