Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ deps = {
'packages': [
{
'package': 'flutter/android/embedding_bundle',
'version': 'last_updated:2024-06-18T12:13:41-0700'
'version': 'last_updated:2024-09-10T16:32:16-0700'
}
],
'condition': 'download_android_deps',
Expand Down
1 change: 1 addition & 0 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ embedding_dependencies_jars = [
"//flutter/third_party/android_embedding_dependencies/lib/viewpager-1.0.0.jar",
"//flutter/third_party/android_embedding_dependencies/lib/window-1.2.0.jar",
"//flutter/third_party/android_embedding_dependencies/lib/window-java-1.2.0.jar",
"//flutter/third_party/android_embedding_dependencies/lib/relinker-1.4.5.jar",
]

action("check_imports") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
import com.getkeepsafe.relinker.ReLinker;
import io.flutter.Log;
import io.flutter.embedding.engine.FlutterEngine.EngineLifecycleListener;
import io.flutter.embedding.engine.dart.PlatformMessageHandler;
Expand Down Expand Up @@ -139,12 +140,11 @@ public FlutterJNI provideFlutterJNI() {
*
* <p>This method should only be called once across all FlutterJNI instances.
*/
public void loadLibrary() {
public void loadLibrary(Context context) {
if (FlutterJNI.loadLibraryCalled) {
Log.w(TAG, "FlutterJNI.loadLibrary called more than once");
}

System.loadLibrary("flutter");
ReLinker.loadLibrary(context, "flutter");
FlutterJNI.loadLibraryCalled = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public InitResult call() {
ResourceExtractor resourceExtractor = initResources(appContext);

try {
flutterJNI.loadLibrary();
flutterJNI.loadLibrary(appContext);
} catch (UnsatisfiedLinkError unsatisfiedLinkError) {
String couldntFindVersion = "couldn't find \"libflutter.so\"";
String notFoundVersion = "dlopen failed: library \"libflutter.so\" not found";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void itReportsInitializedAfterInitializing() {
flutterLoader.ensureInitializationComplete(ctx, null);
shadowOf(getMainLooper()).idle();
assertTrue(flutterLoader.initialized());
verify(mockFlutterJNI, times(1)).loadLibrary();
verify(mockFlutterJNI, times(1)).loadLibrary(ctx);
verify(mockFlutterJNI, times(1)).updateRefreshRate();
}

Expand All @@ -70,7 +70,7 @@ public void unsatisfiedLinkErrorPathDoesNotExist() {

Mockito.doThrow(new UnsatisfiedLinkError("couldn't find \"libflutter.so\""))
.when(mockFlutterJNI)
.loadLibrary();
.loadLibrary(ctx);
try {
flutterLoader.startInitialization(ctx);
} catch (UnsupportedOperationException e) {
Expand Down
3 changes: 3 additions & 0 deletions tools/androidx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Defines the additional Android build time dependencies downloaded by `engine/tools/cipd/android_embedding_bundle`, which then get uploaded to CIPD and pulled by `gclient sync` into `third_party/android_embedding_dependencies/lib/`.

Despite the directory name, `files.json` actually includes one non-androidx dependency: [ReLinker](https://github.com/KeepSafe/ReLinker).
6 changes: 6 additions & 0 deletions tools/androidx/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,11 @@
"out_file_name": "core-1.10.3.aar",
"maven_dependency": "com.google.android.play:core:1.10.3",
"provides": []
},
{
"url": "https://repo1.maven.org/maven2/com/getkeepsafe/relinker/relinker/1.4.5/relinker-1.4.5.aar",
"out_file_name": "relinker-1.4.5.aar",
"maven_dependency": "com.getkeepsafe.relinker:relinker:1.4.5",
"provides": ["com.getkeepsafe.relinker.ReLinker"]
}
]