Skip to content

Commit 74a2ae0

Browse files
committed
[bugfix] fix android o library load
1 parent 65d89f9 commit 74a2ae0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tinker-android/tinker-android-lib/src/main/java/com/tencent/tinker/lib/library/TinkerLoadLibrary.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,26 @@ private static void installNativeLibraryPath(ClassLoader classLoader, File folde
170170
TinkerLog.e(TAG, "installNativeLibraryPath, folder %s is illegal", folder);
171171
return;
172172
}
173+
// android o sdk_int 26
174+
// for android o preview sdk_int 25
173175
if ((Build.VERSION.SDK_INT == 25 && Build.VERSION.PREVIEW_SDK_INT != 0)
174-
|| Build.VERSION.SDK_INT > 25) {
176+
|| Build.VERSION.SDK_INT > 25) {
175177
try {
176178
V25.install(classLoader, folder);
177179
return;
178180
} catch (Throwable throwable) {
179-
// install fail, try to treat it as v14
180-
TinkerLog.e(TAG, "installNativeLibraryPath, v25 fail, sdk: %d, error: %s",
181+
// install fail, try to treat it as v23
182+
// some preview N version may go here
183+
TinkerLog.e(TAG, "installNativeLibraryPath, v25 fail, sdk: %d, error: %s, try to fallback to V23",
181184
Build.VERSION.SDK_INT, throwable.getMessage());
185+
V23.install(classLoader, folder);
182186
}
183-
}
184-
if (Build.VERSION.SDK_INT >= 23) {
187+
} else if (Build.VERSION.SDK_INT >= 23) {
185188
try {
186189
V23.install(classLoader, folder);
187190
} catch (Throwable throwable) {
188191
// install fail, try to treat it as v14
189-
TinkerLog.e(TAG, "installNativeLibraryPath, v23 fail, sdk: %d, error: %s",
192+
TinkerLog.e(TAG, "installNativeLibraryPath, v23 fail, sdk: %d, error: %s, try to fallback to V14",
190193
Build.VERSION.SDK_INT, throwable.getMessage());
191194

192195
V14.install(classLoader, folder);

0 commit comments

Comments
 (0)