question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App doesn't work after installation expo-av package

See original GitHub issue

I just installed bare react-native app with expo-cli and install expo-av library (configure it of course), run it with react-native run-android, and it actually doesn’t work.

Screen Shot 2019-03-19 at 7 00 39 PM

Expo CLI 2.11.9 environment info: System: OS: macOS High Sierra 10.13.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 11.10.0 - /usr/local/bin/node npm: 6.8.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.6 => 0.58.6 npmGlobalPackages: expo-cli: 2.11.9

my MainApplication.java

`package com.mytestapp;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import org.unimodules.adapters.react.ReactAdapterPackage;
import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import org.unimodules.core.interfaces.Package;
import org.unimodules.core.interfaces.SingletonModule;
import expo.modules.constants.ConstantsPackage;
import expo.modules.permissions.PermissionsPackage;
import expo.modules.filesystem.FileSystemPackage;
import expo.modules.av.AVPackage;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {
  private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(Arrays.<Package>asList(
     new ReactAdapterPackage(),
     new ConstantsPackage(),
     new PermissionsPackage(),
     new FileSystemPackage(),
     new AVPackage()
  ), Arrays.<SingletonModule>asList());

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ModuleRegistryAdapter(mModuleRegistryProvider)
      );
    }

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

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sjchmielacommented, Mar 22, 2019

Glad to hear that!

Try adding some style={{ width: 300, height: 300 }} to your Video component. 🙂

1reaction
sjchmielacommented, Mar 22, 2019

I was able to fix this issue by adding

android {
  // ...

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  // ...
}

to android/app/build.gradle. Could you please try this workaround?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo-AV Sound.playAsync() doesn't work with expo-av 9.2.3 ...
Run expo init my-app · Run expo install expo-av · Add some mp3 file to the root directory. I'm using this one. ·...
Read more >
AV - Expo Documentation
Expo uses ExoPlayer implementation by default. To use MediaPlayer , add androidImplementation: 'MediaPlayer' to the initial status of the AV object. Acceptable ...
Read more >
How to Add Videos to your Expo React Native Apps - YouTube
Hi everyone!Today I want to show you how to add videos to your expo react native app using the expo - av package...
Read more >
How to add or play video in React Native Expo Application
Install a package using the command: npm install expo-av ... youtube link and start playing video, because the youtube link doesn't have any ......
Read more >
Video player with React Native. Part 1: Expo | by Paul Keen
You can't use native modules with Expo. Must stick to supported SDK's. The standard library is limited. It is big but still doesn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found