import{_ as s,o as n,c as e,e as a}from"./app.87c2e303.js";const l={},o=a(`<h1 id="api-\u5F02\u5E38\u5904\u7406" tabindex="-1"><a class="header-anchor" href="#api-\u5F02\u5E38\u5904\u7406" aria-hidden="true">#</a> API \u5F02\u5E38\u5904\u7406</h1><blockquote><p>\u5F02\u5E38\u662F\u5728\u5F00\u53D1\u8FC7\u7A0B\u7ECF\u5E38\u9047\u5230\u7684\u4E3B\u8981\u95EE\u9898\uFF0C\u8FD9\u91CC\u4ECB\u7ECD\u4E86 <code>YukiReflection</code> \u5728\u4F7F\u7528\u8FC7\u7A0B\u4E2D\u53EF\u80FD\u9047\u5230\u7684\u5E38\u89C1\u5F02\u5E38\u4EE5\u53CA\u5904\u7406\u65B9\u5F0F\u3002</p></blockquote><p>\u8FD9\u91CC\u7684\u5F02\u5E38\u8BF4\u660E\u53EA\u4F1A\u540C\u6B65\u6700\u65B0\u7684 API \u7248\u672C\uFF0C\u8F83\u65E7\u7684 API \u7248\u672C\u7684\u5F02\u5E38\u5C06\u4E0D\u4F1A\u518D\u8FDB\u884C\u8BF4\u660E\uFF0C\u8BF7\u59CB\u7EC8\u4FDD\u6301 API \u7248\u672C\u4E3A\u6700\u65B0\u3002</p><h2 id="\u975E\u963B\u65AD\u5F02\u5E38" tabindex="-1"><a class="header-anchor" href="#\u975E\u963B\u65AD\u5F02\u5E38" aria-hidden="true">#</a> \u975E\u963B\u65AD\u5F02\u5E38</h2><blockquote><p>\u8FD9\u4E9B\u5F02\u5E38\u4E0D\u4F1A\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C (FC)\uFF0C\u4F46\u662F\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370 <code>E</code> \u7EA7\u522B\u7684\u65E5\u5FD7\uFF0C\u4E5F\u53EF\u80FD\u4F1A\u505C\u6B62\u7EE7\u7EED\u6267\u884C\u76F8\u5173\u529F\u80FD\u3002</p></blockquote><h6 id="exception" tabindex="-1"><a class="header-anchor" href="#exception" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method/Constructor/Field match type &quot;<strong>TYPE</strong>&quot; not allowed</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u8BBE\u7F6E\u4E86\u4E0D\u5141\u8BB8\u7684\u53C2\u6570\u7C7B\u578B\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#6CB6FF;">false</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">1</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">0</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">false</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">field {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2757\u8BBE\u7F6E\u4E86\u65E0\u6548\u7684\u7C7B\u578B\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">false</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u5728\u67E5\u627E\u4E2D <code>param</code>\u3001<code>returnType</code>\u3001<code>type</code> \u4E2D\u4EC5\u63A5\u53D7 <code>Class</code>\u3001<code>String</code>\u3001<code>VariousClass</code> \u7C7B\u578B\u7684\u4F20\u503C\uFF0C\u4E0D\u53EF\u4F20\u5165\u53C2\u6570\u5B9E\u4F8B\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u65B9\u6CD5</span></span>
<span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">BooleanType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">IntType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">IntType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">BooleanType</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u4EE5\u4E0B\u65B9\u6848\u4E5F\u662F\u6B63\u786E\u7684</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;java.lang.Boolean&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#768390;">// \u67E5\u627E\u4E00\u4E2A\u53D8\u91CF</span></span>
<span class="line"><span style="color:#ADBAC7;">field {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u2705 \u6B63\u786E\u7684\u4F7F\u7528\u65B9\u6CD5\u4E3E\u4F8B</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">BooleanType</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h6 id="exception-1" tabindex="-1"><a class="header-anchor" href="#exception-1" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>NoSuchMethod/NoSuchConstructor/NoSuchField happend in [<strong>NAME</strong>]</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u627E\u5230\u76EE\u6807\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u7684\u67E5\u627E\u6761\u4EF6\u662F\u5426\u80FD\u6B63\u786E\u5339\u914D\u5230\u76EE\u6807 <code>Class</code> \u4E2D\u7684\u6307\u5B9A\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002</p><h6 id="exception-2" tabindex="-1"><a class="header-anchor" href="#exception-2" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Trying <strong>COUNT</strong> times and all failure by RemedyPlan</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>RemedyPlan</code> \u91CD\u65B0\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u65F6\u4F9D\u7136\u6CA1\u6709\u627E\u5230\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u3001\u53D8\u91CF\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u786E\u8BA4\u4F60\u8BBE\u7F6E\u7684 <code>RemedyPlan</code> \u53C2\u6570\u4EE5\u53CA\u5F53\u524D APP \u5185\u5B58\u5728\u7684 <code>Class</code>\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-3" tabindex="-1"><a class="header-anchor" href="#exception-3" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>You must set a condition when finding a Method/Constructor/Field</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u65F6\u5E76\u672A\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u8FD9\u91CC\u6CA1\u6709\u8BBE\u7F6E\u4EFB\u4F55\u6761\u4EF6</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u5C06\u67E5\u627E\u6761\u4EF6\u8865\u5145\u5B8C\u6574\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-4" tabindex="-1"><a class="header-anchor" href="#exception-4" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Can&#39;t find this Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiReflection#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7 <code>ClassLoader.searchClass</code> \u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 <code>Class</code> \u5BF9\u8C61\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">custom</span><span style="color:#F69D50;">ClassLoader?</span><span style="color:#ADBAC7;">.searchClass {</span></span>
<span class="line"><span style="color:#ADBAC7;">    from(...)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 <strong>Dex</strong> \u4E2D\u7684 <code>Class</code> \u4EE5\u53CA\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-5" tabindex="-1"><a class="header-anchor" href="#exception-5" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Can&#39;t find this Method/Constructor/Field in [<strong>CLASS</strong>]: <strong>CONTENT</strong> Generated by YukiReflection#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7\u6307\u5B9A\u6761\u4EF6\u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u4EE5\u53CA\u53D8\u91CF\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">TargetClass</span><span style="color:#ADBAC7;">.method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">BooleanType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u662F\u4E00\u4E2A\u5B89\u5168\u5F02\u5E38\uFF0C\u8BF7\u68C0\u67E5\u4F60\u8BBE\u7F6E\u7684\u6761\u4EF6\uFF0C\u4F7F\u7528\u76F8\u5173\u5DE5\u5177\u67E5\u770B\u6240\u5728 <code>Class</code> \u4E2D\u7684\u5B57\u8282\u7801\u5BF9\u8C61\u7279\u5F81\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-6" tabindex="-1"><a class="header-anchor" href="#exception-6" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>The number of VagueType must be at least less than the count of paramTypes</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728 <code>Method</code>\u3001<code>Constructor</code> \u67E5\u627E\u6761\u4EF6\u4E2D\u9519\u8BEF\u5730\u4F7F\u7528\u4E86 <code>VagueType</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F69D50;">TargetClass</span><span style="color:#ADBAC7;">.method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F1&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">VagueType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// &lt;\u60C5\u666F2&gt;</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">VagueType</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">VagueType</span><span style="color:#ADBAC7;"> ...)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p><code>VagueType</code> \u4E0D\u80FD\u5728\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u53C2\u6570\u4E2D\u5B8C\u5168\u586B\u5145\uFF0C\u82E5\u5B58\u5728\u8FD9\u6837\u7684\u9700\u6C42\u8BF7\u4F7F\u7528 <code>paramCount</code>\u3002</p><h6 id="exception-7" tabindex="-1"><a class="header-anchor" href="#exception-7" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Field match type class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u53D8\u91CF\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>type</code> \u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">field {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 type \u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    type </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.TestClass&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>type</code> \u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-8" tabindex="-1"><a class="header-anchor" href="#exception-8" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method match returnType class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>returnType</code> \u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 returnType \u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    returnType </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;com.example.TestClass&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>returnType</code> \u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-9" tabindex="-1"><a class="header-anchor" href="#exception-9" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">loggerE</p><p>Method/Constructor match paramType[<strong>INDEX</strong>] class is not found</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u6240\u8BBE\u7F6E\u7684\u67E5\u627E\u6761\u4EF6\u4E2D <code>param</code> \u7684 <code>index</code> \u53F7\u4E0B\u6807\u7684 <code>Class</code> \u5B9E\u4F8B\u672A\u88AB\u627E\u5230\u3002</p><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u5047\u8BBE\u8FD9\u91CC\u8BBE\u7F6E\u7684 1 \u53F7\u4E0B\u6807\u7684 Class \u5E76\u4E0D\u5B58\u5728</span></span>
<span class="line"><span style="color:#ADBAC7;">    param(</span><span style="color:#F69D50;">StringClass</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">&quot;com.example.TestClass&quot;</span><span style="color:#ADBAC7;">, </span><span style="color:#F69D50;">BooleanType</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u67E5\u627E\u6761\u4EF6\u4E2D <code>param</code> \u7684 <code>index</code> \u53F7\u4E0B\u6807\u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\uFF0C\u7136\u540E\u518D\u8BD5\u4E00\u6B21\u3002</p><h2 id="\u963B\u65AD\u5F02\u5E38" tabindex="-1"><a class="header-anchor" href="#\u963B\u65AD\u5F02\u5E38" aria-hidden="true">#</a> \u963B\u65AD\u5F02\u5E38</h2><blockquote><p>\u8FD9\u4E9B\u5F02\u5E38\u4F1A\u76F4\u63A5\u5BFC\u81F4 APP \u505C\u6B62\u8FD0\u884C (FC)\uFF0C\u540C\u65F6\u4F1A\u5728\u63A7\u5236\u53F0\u6253\u5370 <code>E</code> \u7EA7\u522B\u7684\u65E5\u5FD7\u3002</p></blockquote><h6 id="exception-10" tabindex="-1"><a class="header-anchor" href="#exception-10" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">NoClassDefFoundError</p><p>Can&#39;t find this Class in [<strong>CLASSLOADER</strong>]: <strong>CONTENT</strong> Generated by YukiReflection#ReflectionTool</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u901A\u8FC7 <code>String.toClass(...)</code> \u6216 <code>classOf&lt;...&gt;()</code> \u627E\u4E0D\u5230\u9700\u8981\u67E5\u627E\u7684 <code>Class</code> \u5BF9\u8C61\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#96D0FF;">&quot;com.demo.Test&quot;</span><span style="color:#ADBAC7;">.toClass()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8BF7\u68C0\u67E5\u5F53\u524D\u5B57\u7B26\u4E32\u6216\u5B9E\u4F53\u5339\u914D\u5230\u7684 <code>Class</code> \u662F\u5426\u5B58\u5728\u4E8E\u5F53\u524D <code>ClassLoader</code>\uFF0C\u5E76\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-11" tabindex="-1"><a class="header-anchor" href="#exception-11" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>ClassLoader [<strong>CLASSLOADER</strong>] is not a DexClassLoader</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>ClassLoader.searchClass</code> \u67E5\u627E <code>Class</code> \u4F46\u662F\u5F53\u524D <code>ClassLoader</code> \u5E76\u4E0D\u7EE7\u627F\u4E8E <code>BaseDexClassLoader</code>\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u8FD9\u79CD\u60C5\u51B5\u57FA\u672C\u4E0D\u5B58\u5728\uFF0C\u9664\u975E\u5F53\u524D APP \u5F15\u7528\u4E86\u975E ART \u5E73\u53F0\u7684\u53EF\u6267\u884C\u6587\u4EF6 (\u4F46\u662F\u8FD9\u79CD\u60C5\u51B5\u8FD8\u662F\u4E0D\u4F1A\u5B58\u5728) \u6216\u5F53\u524D <code>ClassLoader</code> \u4E3A\u7A7A\u3002</p><h6 id="exception-12" tabindex="-1"><a class="header-anchor" href="#exception-12" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>VariousClass match failed of those <strong>CLASSES</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u4F7F\u7528 <code>VariousClass</code> \u521B\u5EFA\u4E0D\u786E\u5B9A\u7684 <code>Class</code> \u5BF9\u8C61\u65F6\u5168\u90E8\u7684 <code>Class</code> \u90FD\u6CA1\u6709\u88AB\u627E\u5230\u3002</p><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u68C0\u67E5\u5F53\u524D APP \u5185\u662F\u5426\u5B58\u5728\u5176\u4E2D\u80FD\u591F\u5339\u914D\u7684 <code>Class</code> \u540E\uFF0C\u518D\u8BD5\u4E00\u6B21\u3002</p><h6 id="exception-13" tabindex="-1"><a class="header-anchor" href="#exception-13" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>paramTypes is empty, please use emptyParam() instead</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u67E5\u627E\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u65F6\u4FDD\u7559\u4E86\u7A7A\u7684 <code>param</code> \u65B9\u6CD5\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// \u62EC\u53F7\u5185\u6CA1\u6709\u586B\u5199\u4EFB\u4F55\u53C2\u6570</span></span>
<span class="line"><span style="color:#ADBAC7;">    param()</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u82E5\u8981\u6807\u8BC6\u6B64\u65B9\u6CD5\u3001\u6784\u9020\u65B9\u6CD5\u6CA1\u6709\u53C2\u6570\uFF0C\u4F60\u53EF\u4EE5\u6709\u5982\u4E0B\u8BBE\u7F6E\u65B9\u6CD5\u3002</p><p>\u7B2C\u4E00\u79CD\uFF0C\u8BBE\u7F6E <code>emptyParam</code> (\u63A8\u8350)</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    emptyParam()</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u7B2C\u4E8C\u79CD\uFF0C\u8BBE\u7F6E <code>paramCount = 0</code></p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">method {</span></span>
<span class="line"><span style="color:#ADBAC7;">    name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    paramCount </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">0</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h6 id="exception-14" tabindex="-1"><a class="header-anchor" href="#exception-14" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Cannot create classes cache for &quot;android&quot;, please remove &quot;name&quot; param</p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u5728\u7CFB\u7EDF\u6846\u67B6 (android) \u4E2D\u4F7F\u7528\u4E86 <code>DexClassFinder</code> \u7684\u7F13\u5B58\u529F\u80FD <code>searchClass(name = ...)</code>\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">searchClass(name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;test&quot;</span><span style="color:#ADBAC7;">) {</span></span>
<span class="line"><span style="color:#ADBAC7;">    from(...)</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// ...</span></span>
<span class="line"><span style="color:#ADBAC7;">}.get()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><p>\u7531\u4E8E\u7F13\u5B58\u4F1A\u5C06\u627E\u5230\u7684 <code>Class</code> \u540D\u79F0\u5B58\u5165 <code>SharedPreferences</code>\uFF0C\u4F46\u662F\u7CFB\u7EDF\u6846\u67B6\u4E0D\u5B58\u5728 data \u76EE\u5F55\uFF0C\u6240\u4EE5\u8BF7\u4E0D\u8981\u5728\u7CFB\u7EDF\u6846\u67B6\u4E2D\u4F7F\u7528\u6B64\u529F\u80FD\u3002</p><h6 id="exception-15" tabindex="-1"><a class="header-anchor" href="#exception-15" aria-hidden="true">#</a> exception</h6><div class="custom-container danger"><p class="custom-container-title">IllegalStateException</p><p>Target Class type cannot cast to <strong>TYPE</strong></p></div><p><strong>\u5F02\u5E38\u539F\u56E0</strong></p><p>\u4F7F\u7528 <code>Class.toClass</code>\u3001<code>Class.toClassOrNull</code>\u3001<code>GenericClass.argument</code> \u65B9\u6CD5\u5C06\u5B57\u7B26\u4E32\u7C7B\u540D\u8F6C\u6362\u4E3A\u76EE\u6807 <code>Class</code> \u65F6\u58F0\u660E\u4E86\u9519\u8BEF\u7684\u7C7B\u578B\u3002</p><p>\u4EE5\u4E0B\u4F7F\u7528 <code>Class.toClass</code> \u65B9\u6CD5\u6765\u8FDB\u884C\u793A\u4F8B\u3002</p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// \u5047\u8BBE\u76EE\u6807\u7C7B\u578B\u662F Activity \u4F46\u662F\u88AB\u9519\u8BEF\u5730\u8F6C\u6362\u4E3A\u4E86 WrongClass \u7C7B\u578B</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&quot;</span><span style="color:#ADBAC7;">.toClass</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">WrongClass</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>\u89E3\u51B3\u65B9\u6848</strong></p><blockquote><p>\u793A\u4F8B\u5982\u4E0B</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#768390;">// &lt;\u89E3\u51B3\u65B9\u6848 1&gt; \u586B\u5199\u6B63\u786E\u7684\u7C7B\u578B</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz1 </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&quot;</span><span style="color:#ADBAC7;">.toClass</span><span style="color:#F47067;">&lt;</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">&gt;</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"><span style="color:#768390;">// &lt;\u89E3\u51B3\u65B9\u6848 2&gt; \u4E0D\u586B\u5199\u6CDB\u578B\u58F0\u660E</span></span>
<span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> clazz2 </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;android.app.Activity&quot;</span><span style="color:#ADBAC7;">.toClass()</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>\u8BF7\u786E\u4FDD\u6267\u884C\u65B9\u6CD5\u540E\u58F0\u660E\u7684\u6CDB\u578B\u662F\u6307\u5B9A\u7684\u76EE\u6807 <code>Class</code> \u7C7B\u578B\uFF0C\u5728\u4E0D\u786E\u5B9A\u76EE\u6807\u7C7B\u578B\u7684\u60C5\u51B5\u4E0B\u4F60\u53EF\u4EE5\u4E0D\u9700\u8981\u586B\u5199\u6CDB\u578B\u58F0\u660E\u3002</p>`,137),p=[o];function c(t,i){return n(),e("div",null,p)}const d=s(l,[["render",c],["__file","api-exception.html.vue"]]);export{d as default};
