diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle index 0d00ce694..19236f572 100644 --- a/android/sdk/build.gradle +++ b/android/sdk/build.gradle @@ -48,6 +48,7 @@ dependencies { implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.squareup.duktape:duktape-android:1.3.0' implementation 'com.google.code.gson:gson:2.8.6' + implementation "androidx.startup:startup-runtime:1.1.0" if (rootProject.ext.libreBuild) { implementation(project(':react-native-device-info')) { diff --git a/android/sdk/src/main/AndroidManifest.xml b/android/sdk/src/main/AndroidManifest.xml index 78199d9b1..9bf692223 100644 --- a/android/sdk/src/main/AndroidManifest.xml +++ b/android/sdk/src/main/AndroidManifest.xml @@ -57,6 +57,14 @@ android:enabled="false" tools:replace="android:authorities"> + + + + \ No newline at end of file diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiInitializer.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiInitializer.java new file mode 100644 index 000000000..9b4f1f5be --- /dev/null +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiInitializer.java @@ -0,0 +1,42 @@ +/* + * Copyright @ 2021-present 8x8, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jitsi.meet.sdk; + +import android.content.Context; + +import androidx.annotation.NonNull; +import androidx.startup.Initializer; + +import com.facebook.soloader.SoLoader; + +import java.util.ArrayList; +import java.util.List; + +public class JitsiInitializer implements Initializer { + + @NonNull + @Override + public Boolean create(@NonNull Context context) { + SoLoader.init(context, /* native exopackage */ false); + return true; + } + + @NonNull + @Override + public List>> dependencies() { + return new ArrayList<>(); + } +} \ No newline at end of file diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java index c5879d7cf..cfb66e324 100644 --- a/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java +++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java @@ -30,7 +30,6 @@ import com.facebook.react.devsupport.DevInternalSettings; import com.facebook.react.jscexecutor.JSCExecutorFactory; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.uimanager.ViewManager; -import com.facebook.soloader.SoLoader; import com.oney.WebRTCModule.RTCVideoViewManager; import com.oney.WebRTCModule.WebRTCModule; @@ -174,8 +173,6 @@ class ReactInstanceManagerHolder { return; } - SoLoader.init(activity.getApplication(), /* native exopackage */ false); - List packages = new ArrayList<>(Arrays.asList( new com.calendarevents.CalendarEventsPackage(),