react-native-jitsi-meet: Android crash with Jitsi-Meet: Module AppRegistry is not a registered callable module (calling runApplication) - Jitsi-meet
I am using react-native-Jitsi-Meet dependency in android for one of my react native application. I setup everything in Android and calling initialize method from React Native. It always crashes on android saying
Module AppRegistry is not a registered callable module (calling runApplication)
Here is full crash log:
2019-05-23 19:42:17.157 9640-9722/com.telecare E/ReactNativeJS: null is not an object (evaluating 'M.Aspect')
2019-05-23 19:42:17.169 9640-9722/com.telecare E/ReactNativeJS: Module
AppRegistry is not a registered callable module (calling runApplication)
2019-05-23 19:42:17.174 9640-9723/com.telecare E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.telecare , PID: 9640
com.facebook.react.common.JavascriptException: null is not an object (evaluating 'M.Aspect'), stack:
<unknown>@944:6009
h@2:1670
<unknown>@943:292
h@2:1670
<unknown>@942:280
h@2:1670
<unknown>@11:743
h@2:1670
d@2:868
global code@1008:4
at
com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at
com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at
com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
at java.lang.Thread.run(Thread.java:764)
Code I am using in Android which is being called from React-Native:
JitsiMeet.initialize();
JitsiMeetEvents.addListener('CONFERENCE_LEFT', (data) => {
console.log('CONFERENCE_LEFT');
});
JitsiMeetEvents.addListener('CONFERENCE_JOINED', (data) => {
console.log('CONFERENCE_JOINED');
});
JitsiMeetEvents.addListener('CONFERENCE_WILL_JOIN', (data) => {
console.log('CONFERENCE_WILL_JOIN');
});
setTimeout(() => {
JitsiMeet.call("XXXX");
}, 5000);
when this line JitsiMeet.call("XXXX"); is being called, it opens another screen and crash in android just after that.
Here is my Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<permission android:name="com.telehealthcare.permission.JITSI_BROADCAST"
android:label="Jitsi Meet Event Broadcast"
android:protectionLevel="normal"></permission>
<uses-permission android:name="com.telehealthcare.permission.JITSI_BROADCAST"/>
<application
android:name=".MainApplication"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.reactnativejitsimeet.JitsiMeetNavigatorActivity" />
</application>
Here is my app level build.gradle:
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
bundleAssetName: "app.bundle",
]
apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.healthcare"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-camera')
implementation project(':react-native-cardview')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.facebook.fresco:animated-gif:1.10.0'
// implementation project(':react-native-vector-icons')
implementation project(':react-native-contacts')
implementation project(':react-native-jitsi-meet')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
Here is my project level build.gradle file:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
maven { // <---- Add this block
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { // <---- Add this block
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
I also made a sample application for android only using same jitsi-meet dependency for android and everything works well.
It has been 2 days I am trying to resolve this issue. Any help will be appreciate!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (6 by maintainers)
Hi @ngoctan95,
With react-native-jitsi-meet installed, index.android.bundle is Jitsi Meet so your bundle name has changed to app.bundle. The command would then be:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/app.bundle --assets-dest android/app/src/main/res