React-native-firebase: not abstract and does not override abstract method createJSModules() in ReactPackage

Created on 13 Nov 2017  路  9Comments  路  Source: invertase/react-native-firebase

Issue

  1. Application Target Platform: Both

  1. Development Operating System: macOS High Sierra

  1. Build Tools: Android Studio:3,Android SDK version:23.0.1

  1. React Native version: 0.45.1

  1. RNFirebase Version: 3.1.0

  1. Firebase Module: All Modules

Terminal error output ->react-native run-android

.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/database/RNFirebaseDatabasePackage.java:15: error: RNFirebaseDatabasePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseDatabasePackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/firestore/RNFirebaseFirestorePackage.java:15: error: RNFirebaseFirestorePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseFirestorePackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/config/RNFirebaseRemoteConfigPackage.java:15: error: RNFirebaseRemoteConfigPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseRemoteConfigPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/auth/RNFirebaseAuthPackage.java:15: error: RNFirebaseAuthPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseAuthPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/RNFirebasePackage.java:17: error: RNFirebasePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebasePackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/admob/RNFirebaseAdMobPackage.java:16: error: RNFirebaseAdMobPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseAdMobPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/crash/RNFirebaseCrashPackage.java:15: error: RNFirebaseCrashPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseCrashPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java:17: error: RNFirebaseStoragePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseStoragePackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/links/RNFirebaseLinksPackage.java:15: error: RNFirebaseLinksPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseLinksPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/perf/RNFirebasePerformancePackage.java:15: error: RNFirebasePerformancePackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebasePerformancePackage implements ReactPackage {
       ^
../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingPackage.java:15: error: RNFirebaseMessagingPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseMessagingPackage implements ReactPackage {
       ^
.../node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java:17: error: RNFirebaseAnalyticsPackage is not abstract and does not override abstract method createJSModules() in ReactPackage
public class RNFirebaseAnalyticsPackage implements ReactPackage {
       ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
12 errors


package.js:
``` "dependencies": {
"apsl-react-native-button": "3.0.2",
"binfix": "0.0.4",
"entities": "^1.1.1",
"format-json": "^1.0.3",
"immutable": "3.8.1",
"key-mirror": "1.0.1",
"moment": "^2.19.2",
"native-base": "2.2.0",
"parse": "1.8.5",
"prop-types": "^15.6.0",
"ramda": "^0.24.1",
"ramdasauce": "^2.1.0",
"react": "16.0.0-alpha.12",
"react-dom": "15.4.2",
"react-mixin": "3.0.5",
"react-native": "0.45.1",
"react-native-config": "^0.2.1",
"react-native-device-info": "^0.10.0",
"react-native-drawer": "^2.3.0",
"react-native-fetch-blob": "^0.10.8",
"react-native-firebase": "^3.1.0",
"react-native-google-places": "^2.4.2",
"react-native-htmlview": "^0.12.1",
"react-native-i18n": "1.0.0",
"react-native-image-crop-picker": "0.16.1",
"react-native-image-resizer": "^1.0.0",
"react-native-image-zoom-viewer": "^2.0.12",
"react-native-maps": "^0.17.1",
"react-native-modal-datetime-picker": "4.11.0",
"react-native-modal-picker": "0.0.16",
"react-native-modalbox": "^1.4.2",
"react-native-navbar": "1.6.0",
"react-native-progress-circle": "^2.0.0",
"react-native-router-flux": "^4.0.0-beta.23",
"react-native-simple-store": "1.1.0",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.0-beta.19",
"react-redux": "^5.0.2",
"react-timer-mixin": "0.13.3",
"redux": "^3.6.0",
"redux-persist": "^4.10.2",
"redux-thunk": "2.2.0",
"reduxsauce": "0.4.1",
"regenerator": "0.8.46",
"seamless-immutable": "^7.0.1",
"striptags": "^3.1.0",
"tcomb-form-native": "0.6.5",
"undefined": "0.1.0",
"underscore": "1.8.3",
"validate.js": "0.10.0"
},
"devDependencies": {
"babel-core": "6.17.0",
"babel-eslint": "7.0.0",
"babel-jest": "20.0.3",
"babel-plugin-ignite-ignore-reactotron": "^0.3.0",
"babel-plugin-transform-remove-console": "^6.8.5",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react-native": "2.0.0",
"docker": "1.0.0",
"enzyme": "^2.6.0",
"eslint": "3.8.1",
"eslint-config-standard": "6.2.0",
"eslint-formatter-pretty": "1.1.0",
"eslint-plugin-flowtype-errors": "1.4.1",
"eslint-plugin-promise": "3.3.0",
"eslint-plugin-react": "6.9.0",
"eslint-plugin-standard": "2.0.1",
"ignite-ir-boilerplate": "^2.2.2",
"istanbul": "0.4.5",
"jest": "20.0.4",
"mockery": "^2.0.0",
"react-addons-test-utils": "~15.4.1",
"react-dom": "~15.4.1",
"react-test-renderer": "16.0.0-alpha.12",
"reactotron-react-native": "^1.12.0",
"reactotron-redux": "^1.11.1",
"reactotron-redux-saga": "^1.11.1",
"redux-mock-store": "1.2.1"
},

Android/app/build.gradle

dependencies {
compile(project(':react-native-firebase')) {
transitive = false
}
compile project(':react-native-image-resizer')
compile project(':react-native-fetch-blob')
compile project(':react-native-image-crop-picker')
compile project(':react-native-vector-icons')

compile "com.google.android.gms:play-services-base:11.4.2"
compile "com.google.firebase:firebase-core:11.4.2"

compile(project(':react-native-maps')){
    exclude group: 'com.google.android.gms'
}
compile(project(':react-native-google-places')){
    exclude group: 'com.google.android.gms'
}
compile ("com.google.android.gms:play-services-base:11.4.2") {
    force = true;
}
compile ("com.google.android.gms:play-services-maps:11.4.2") {
    force = true;
}
compile ("com.google.android.gms:play-services-places:11.4.2") {
    force = true;
}

compile project(':react-native-i18n')
compile (project(':react-native-device-info')){
    exclude group: "com.google.android.gms"
}
compile project(':react-native-config')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"  // From node_modules

}

// 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'
}

apply plugin: 'com.google.gms.google-services'

Android/build.gradle

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com'
}
}
}
```

Most helpful comment

Got it working, stupid quotes :)

it should be:

maven { url "$rootDir/../node_modules/react-native/android" }

note the double quotes, not single :(

All 9 comments

For completeness, your RN version is too low, need to be on 48 or higher for 3.1.x

Same problem. RN version is 0.50.4
see https://github.com/invertase/react-native-firebase/issues/460#issuecomment-334255092

same problem on RN v 0.51.0

@UADACID check RNFirebase Version,
screen shot 2018-03-07 at 8 03 03 pm

Thx, solved 馃憤

@UADACID how did you solve it? I'm with RN 0.54.2, and react-native-firebase 3.3.1 - and I have the same errors when I try to build my android project.

@giladno it's because your android build isn't loading react native from your node_modules, but the remote jcentre repository (https://bintray.com/bintray/jcenter/com.facebook.react:react-native/view) which has a really old version.

Ensure the following is in your build.gradle file and rebuild - if it already is, invalidate caches and restart android studio and rebuild

 maven {
  // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  url "$rootDir/../node_modules/react-native/android"
}

@Ehesp This is what I have in my build.grade:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven { url '$rootDir/../node_modules/react-native/android' }
        maven { url 'https://jitpack.io' }
        maven { url 'https://maven.google.com' }
    }
}

Invalidating cache didn't help :(

Got it working, stupid quotes :)

it should be:

maven { url "$rootDir/../node_modules/react-native/android" }

note the double quotes, not single :(

Was this page helpful?
0 / 5 - 0 ratings