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 TV Build failed, package com.brentvatne.react does not exist #1288

Closed
Stanley-Yao opened this issue Oct 14, 2018 · 4 comments
Closed

Comments

@Stanley-Yao
Copy link

Current behavior

Describe what happens when you encounter this issue.

:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
E:\Code\mmb\android\app\src\main\java\com\mmb\MainApplication.java:6: error: package com.brentvatne.react does not exist
import com.brentvatne.react.ReactVideoPackage;
                           ^
E:\Code\mmb\android\app\src\main\java\com\mmb\MainApplication.java:27: error: cannot find symbol
        new ReactVideoPackage()
            ^
  symbol: class ReactVideoPackage
2 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Reproduction steps

I have run react-native link react-native-video

rnpm-install info Linking react-native-video android dependency
rnpm-install info Platform 'android' module react-native-video has been successfully linked

Here is the package.json

{
  "name": "mmb",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-video": "^3.0.0",
    "react-navigation": "^2.18.0"
  },
  "devDependencies": {
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.4.2",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

Expected behavior

Should Run as the others

Platform

Which player are you experiencing the problem on:

  • Android ExoPlayer

Does anyone have the same issue? Or could anyone please help with that? Thanks

@cobarx
Copy link
Contributor

cobarx commented Oct 15, 2018

This looks like a linking issue. Even though you did the link step, sometimes it won't work properly. I would do react-native unlink react-native-video and try again. Also try restarting Android Studio as it will sometimes get in a state where it doesn't pick up the dependencies properly.

@cobarx
Copy link
Contributor

cobarx commented Oct 15, 2018

Check that you have the react-native-video entry in both your settings.gradle and app/build.gradle. Since it's not working properly, you may need to add the lines manually as described in the install instructions.

@cobarx cobarx closed this as completed Oct 19, 2018
@jrhager84
Copy link

This looks like a linking issue. Even though you did the link step, sometimes it won't work properly. I would do react-native unlink react-native-video and try again. Also try restarting Android Studio as it will sometimes get in a state where it doesn't pick up the dependencies properly.

what does unlinking and 'trying again' mean? yarn add? Do you delete the auto added entries in each of the files (e.g. MainActivity etc?)

@freeboub
Copy link
Collaborator

"react-native": "0.55.4", I don't think this is compatible with react-native-video.

You should try to add following content in react-native.config.js from react-native-video package source:

module.exports = {
dependency: {
platforms: {
android: {
packageImportPath: 'import com.brentvatne.ReactVideoPackage;',
packageInstance: 'new ReactVideoPackage()',
},
},
},
}

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

4 participants