Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android crash with Jitsi-Meet: Module AppRegistry is not a registered callable module (calling runApplication) - Jitsi-meet #33

Closed
MeghsP opened this issue May 24, 2019 · 19 comments

Comments

@MeghsP
Copy link

MeghsP commented May 24, 2019

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!

@skrafft
Copy link
Owner

skrafft commented May 27, 2019

Hi @MeghsP,

Your error seems to be related to react-native-camera that is not properly linked.

https://stackoverflow.com/questions/54645461/getting-error-in-camera-react-native-null-is-not-an-object

Are you able to verify that everything is correctly setup ?

@MeghsP
Copy link
Author

MeghsP commented May 27, 2019

Hi @skrafft , Thanks for your reply. To clear this doubt of react camera linking in app, I try to open react native camera on Splash screen and everything works fine. Camera opens successfully.

import { RNCamera } from 'react-native-camera';
<RNCamera
            ref={ref => {
              this.camera = ref;
            }}
            style={Styles.gifImage}
            type={RNCamera.Constants.Type.back}
            flashMode={RNCamera.Constants.FlashMode.on}
          />

so I don't think it has any issue with react-native-camera. Also app is being crashed from Android not from React-Native. It gives ANR saying "<app_name> has stopped Open app again" and gives above error in Android Studio logs only when I try to call jitsi meet functions.

@MeghsP
Copy link
Author

MeghsP commented May 27, 2019

Hi @skrafft , Now I have totally removed react-native-camera from my application. Now when I call your code:

@ReactMethod
    public void initialize() {
      Log.e("JitsiMeet", "Initialize");
      ReactApplicationContext context = getReactApplicationContext();
      this.eventEmitter = context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
      JitsiBroadcastReceiver receiver = new JitsiBroadcastReceiver();
      receiver.setReactModule(this);
      IntentFilter filter = new IntentFilter();
      filter.addAction("CONFERENCE_FAILED");
      filter.addAction("CONFERENCE_JOINED");
      filter.addAction("CONFERENCE_LEFT");
      filter.addAction("CONFERENCE_WILL_JOIN");
      filter.addAction("CONFERENCE_WILL_LEAVE");
      filter.addAction("LOAD_CONFIG_ERROR");
      context.getCurrentActivity().registerReceiver(receiver, filter, context.getPackageName() + ".permission.JITSI_BROADCAST", null);
    }

    @ReactMethod
    public void call(String url) {
        ReactApplicationContext context = getReactApplicationContext();
        Intent intent = new Intent(context, JitsiMeetNavigatorActivity.class);
        intent.putExtra("url", url);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

From React-native like this:

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("MeghsP");
      }, 5000);

When JitsiMeet.call("MeghsP"); is being called, it opens new screen for a few seconds and then app is being crashed with below error logs.

2019-05-27 14:29:03.091 2121-2311/com.telehealthcare E/ReactNativeJS: Application App has not been registered.
    
    Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
    If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
    
    This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-05-27 14:29:03.105 2121-2313/com.telehealthcare E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.telehealthcare, PID: 2121
    com.facebook.react.common.JavascriptException: Application App has not been registered.
    
    Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
    If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
    
    This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
    
    , stack:
    runApplication@337:1375
    value@29:3311
    <unknown>@29:822
    value@29:2565
    value@29:794
    value@-1
    
        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)

@skrafft
Copy link
Owner

skrafft commented May 27, 2019

Hi @MeghsP,

Can you confirm that you are using v1.2.0 of react-native-jitsi-meet ?
Can you make sure that points 4- and 7- of the install readme for Android are ok ?

@MeghsP
Copy link
Author

MeghsP commented May 27, 2019

Hi @skrafft ,

This is what in my app's package.json file which seems correct:
"react-native-jitsi-meet": "^1.2.0",

This is my app's build.gradle file:

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.telehealthcare"
        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'
}

And this is the code from my MainApplication.java:

@Override
   protected String getJSMainModuleName() {
     return "index";
   }

   @Override
   protected @Nullable String getBundleAssetName() {
     return "app.bundle";
   }

@skrafft
Copy link
Owner

skrafft commented May 27, 2019

It seems to be fine. Would you be able to share your repository with me so that I can investigate more ?

@MeghsP
Copy link
Author

MeghsP commented May 27, 2019

@skrafft Yes sure, Give me sometime. I will upload latest code and provide you that

@MeghsP
Copy link
Author

MeghsP commented May 27, 2019

@skrafft , Here is my full code in test application.
My App

It will be very helpful if this issue will be resolved! Thanks!

@skrafft
Copy link
Owner

skrafft commented May 28, 2019

Hi @MeghsP,

I did tests with your app and managed to make it work by doing the followings:

  1. Remove node_modules folder and run npm install
    2.Remove the file android/app/src/main/assets/index.android.bundle which is useless and conflicts with react-native-jitsi-meet
  2. Instead of calling JitsiMeet.call("Meghs");, you have to call JitsiMeet.call("https://meet.jit.si/Meghs");

With the 3 changes, the project works fine on my side.

@MeghsP
Copy link
Author

MeghsP commented May 28, 2019

Hi @skrafft ,

I tried your solution and run my app. It still gives me same error. Did you change anything else in code?

This is my code from react-native:

onButtonClicked(){
      console.log('Button clicked');
      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("https://meet.jit.si/MeghsP");
      }, 5000);
   }

It still gives following error:

`com.apitestdemo E/ReactNativeJS: Application App has not been registered.
    
    Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
    If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
    
    This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
2019-05-28 21:43:52.051 6208-6311/com.apitestdemo E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.apitestdemo, PID: 6208
    com.facebook.react.common.JavascriptException: Application App has not been registered.
    
    Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
    If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').
    
    This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.
    
    , stack:
    runApplication@334:1375
    value@28:3311
    <unknown>@28:822
    value@28:2565
    value@28:794
    value@-1
    
        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)
2019-05-28 21:43:52.137 5739-6079/? E/PhoneWindow_APM :: isCalledPackage return false
2019-05-28 21:43:52.143 6208-6208/com.apitestdemo E/ActivityThread: Activity com.apitestdemo.MainActivity has leaked IntentReceiver com.reactnativejitsimeet.JitsiBroadcastReceiver@4172854 that was originally registered here. Are you missing a call to unregisterReceiver()?
    android.app.IntentReceiverLeaked: Activity com.apitestdemo.MainActivity has leaked IntentReceiver com.reactnativejitsimeet.JitsiBroadcastReceiver@4172854 that was originally registered here. Are you missing a call to unregisterReceiver()?
        at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1357)
        at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1122)
        at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1428)
        at android.app.ContextImpl.registerReceiver(ContextImpl.java:1401)
        at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:635)
        at com.reactnativejitsimeet.JitsiMeetModule.initialize(JitsiMeetModule.java:39)
        at com.facebook.react.bridge.ModuleHolder.doInitialize(ModuleHolder.java:223)
        at com.facebook.react.bridge.ModuleHolder.markInitializable(ModuleHolder.java:98)
        at com.facebook.react.bridge.NativeModuleRegistry.notifyJSInstanceInitialized(NativeModuleRegistry.java:102)
        at com.facebook.react.bridge.CatalystInstanceImpl$2.run(CatalystInstanceImpl.java:405)
        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)`

It seems that this code is calling another module called App from Jitsi-Meet dependency which is not registered by my app because I register my own application's name in AppRegistry. Also it says you are running the packager from a wrong folder. This seems because from command line I run my project from its path and jitsi-meet dependency calling their own module App which need its separate metro server to run. This is what it seems to me. I don't have any option to figure this out. It has been a lot of days and this issue is taking too much time. If possible please share your updated code.

@skrafft
Copy link
Owner

skrafft commented Jun 8, 2019

@MeghsP did you remove the file android/app/src/main/assets/index.android.bundle which is useless and conflicts with react-native-jitsi-meet. It seems that you did not.

@ngoctan95
Copy link

ngoctan95 commented Jun 10, 2019

@skrafft , after I deleted index.android.bundle, how can I do generate apk file in release mode? Because of the release mode need the bundle generated with this command line:

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

If I removed this file, I will get err and crash on start up in release mode:

Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'app.bundle' is packaged correctly for release.

Note that it works in debug mode.
Do you have solution for this? Thanks

@skrafft
Copy link
Owner

skrafft commented Jun 11, 2019

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

@MeghsP
Copy link
Author

MeghsP commented Jun 11, 2019

Hi @skrafft ,

I am using your library for react-native and it has added jitsi-meet as a dependency not as a module and it has not changed bundle name as app.bundle it is still index.android.bundle and I tried everything whatever you wrote but no luck. It has too many days for this issue and it is not figuring out anymore. Please share your working example if you have any. I will deploy it on my system and will check if its working on my system or not.
Thanks!

@MeghsP
Copy link
Author

MeghsP commented Jun 11, 2019

Hi @skrafft ,

After doing a lot of struggle now when I removed index.android.bundle file from assets and then execute "react-native run-android" it runs my app perfectly. Issue is when I share that APK to install into other device it always crash there and says

Unable to load script. Make sure you're either running a Metro server(run react-native start)or that your bundle "app.bundle" is packaged correctly for release.

Any solution for this?

@ngoctan95
Copy link

I build successfully after deleting the index.android.bundle and just run the command line for release mode.

@MeghsP
Copy link
Author

MeghsP commented Jun 11, 2019

@ngoctan95 ,
Great! so does it work only for release mode and not on debug build? I am facing unable to load script metro server issue in debug build.

@ngoctan95
Copy link

No. For the both release mode and debug, it works.

@MeghsP
Copy link
Author

MeghsP commented Jun 12, 2019

Hi @skrafft ,

Regarding latest issue of unable to load script, it resolved only when I generate a release build. So at the end, everything works fine now including jitsi-meet video conference.

Going to close this issue now.

Thanks for all your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants