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

Build Fails in React-Native Version 0.52.0 #2493

Closed
ghost opened this issue Jan 8, 2018 · 34 comments
Closed

Build Fails in React-Native Version 0.52.0 #2493

ghost opened this issue Jan 8, 2018 · 34 comments

Comments

@ghost
Copy link

ghost commented Jan 8, 2018

I am trying to install this library in my project. However, the build is failing, I followed all the install steps but the errors just dont go away.

I think this library might not be compatible with version 52 of react-native. I might be wrong though. I will share my build.gradle files.

app/build.gradle

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.3"

    defaultConfig {
        applicationId "com.kaaddevelopers.pitchit"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    dexOptions {
            jumboMode = true
            incremental true
            javaMaxHeapSize "4g"
        }
    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"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            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 {
    compile project(':react-native-video-processing')
    compile project(':react-native-video')
    compile project(':react-native-vector-icons')
    compile project(':react-native-svg')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-navigation')
        compile(project(':react-native-firebase')) {
                transitive = false
                exclude group: 'com.google.android.gms:play-services-base:11.4.2'
                exclude group: 'com.google.firebase:firebase-core:11.4.2'
                exclude group: 'com.google.firebase:firebase-config:11.4.2'
                exclude group: 'com.google.firebase:firebase-auth:11.4.2'
                exclude group: 'com.google.firebase:firebase-database:11.4.2'
                exclude group: 'com.google.firebase:firebase-storage:11.4.2'
                exclude group: 'com.google.firebase:firebase-messaging:11.4.2'
                exclude group: 'com.google.firebase:firebase-crash:11.4.2'
                exclude group: 'com.google.firebase:firebase-perf:11.4.2'
                exclude group: 'com.google.firebase:firebase-ads:11.4.2'
                exclude group: 'com.google.firebase:firebase-firestore:11.4.2'
                exclude group: 'com.google.firebase:firebase-invites:11.4.2'
            }

        //Firebase dependencies
        compile ("com.google.android.gms:play-services-base:11.8.0"){
               force = true;
        }
        compile ("com.google.firebase:firebase-core:11.8.0"){
               force = true;
        }
        compile ("com.google.firebase:firebase-auth:11.8.0"){
               force = true;
        }
        compile ("com.google.firebase:firebase-firestore:11.8.0"){
               force = true;
        }
        compile ("com.google.firebase:firebase-storage:11.8.0"){
               force = true;
        }
        compile ("com.google.firebase:firebase-messaging:11.8.0"){
               force = true;
        }
    compile project(':react-native-fetch-blob')
    compile project(':react-native-device-info')
    compile project(':react-native-camera')
    compile project(':lottie-react-native')
    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'

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

MainApplication

public class MainApplication extends NavigationApplication {

     @Override
     public boolean isDebug() {
         // Make sure you are using BuildConfig from your own application
         return BuildConfig.DEBUG;
     }

     protected List<ReactPackage> getPackages() {
         // Add additional packages you require here
         // No need to add RnnPackage and MainReactPackage
         return Arrays.<ReactPackage>asList(
             new RNVideoProcessingPackage(),
             new ReactVideoPackage(),
             new VectorIconsPackage(),
             new SvgPackage(),
             new LinearGradientPackage(),
             new RNFirebasePackage(),
             new RNFetchBlobPackage(),
             new RNDeviceInfo(),
             new RCTCameraPackage(),
             new LottiePackage()
         );
     }

     @Override
     public List<ReactPackage> createAdditionalReactPackages() {
         return getPackages();
     }
     @Override
     public String getJSMainModuleName() {
         return "index";
     }

     @Override
     protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
     }
 }

MainActivity

import com.reactnativenavigation.controllers.SplashActivity;

 public class MainActivity extends SplashActivity {

 }

Build Error

node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:5: error: cannot find symbol
import com.facebook.react.devsupport.ReactInstanceDevCommandsHandler;
                                    ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: package com.facebook.react.devsupport
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:41: error: cannot find symbol
    private static class DevCommandsHandlerProxy implements ReactInstanceDevCommandsHandler {
                                                            ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class JsDevReloadListenerReplacer
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:33: error: cannot find symbol
    private ReactInstanceDevCommandsHandler getOriginalHandler() {
            ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class JsDevReloadListenerReplacer
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:42: error: cannot find symbol
        private ReactInstanceDevCommandsHandler originalReactHandler;
                ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class DevCommandsHandlerProxy
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:45: error: cannot find symbol
        DevCommandsHandlerProxy(ReactInstanceDevCommandsHandler originalReactHandler, Listener listener) {
                                ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class DevCommandsHandlerProxy
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:22: error: cannot find symbol
        ReactInstanceDevCommandsHandler originalHandler = getOriginalHandler();
        ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class JsDevReloadListenerReplacer
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:34: error: cannot find symbol
        return (ReactInstanceDevCommandsHandler) ReflectionUtils.getDeclaredField(reactInstanceManager, "mDevInterface");
                ^
  symbol:   class ReactInstanceDevCommandsHandler
  location: class JsDevReloadListenerReplacer
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:50: error: method does not override or implement a method from a supertype
        @Override
        ^
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:56: error: method does not override or implement a method from a supertype
        @Override
        ^
\node_modules\react-native-navigation\android\app\src\main\java\com\reactnativenavigation\react\JsDevReloadListenerReplacer.java:62: error: method does not override or implement a method from a supertype
        @Override
        ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
10 errors
:react-native-navigation:compileReleaseJavaWithJavac FAILED

I was using this library in my previous project and I noticed that the react-native version has changed so I am using this is the case. Otherwise any suggestions?

Environment

  • React Native Navigation version: 1.1.334
  • React Native version: 0.52.0
  • Platform(s) (iOS, Android, or both?): Both
  • Device info (Simulator/Device? OS version? Debug/Release?): Debug

UPDATE
Just tested on react-native version: 0.51.0 and react: 16.2.0. Everything works !

@ghost ghost changed the title Cannot find symbol while trying to install this library Build Fails in React-Native Version 0.52.0 Jan 8, 2018
@danilobuerger
Copy link
Collaborator

I can confirm that upgrading to 0.52.0 breaks the build on android :(
@guyca any idea?

@gvillenave
Copy link

+1

@Moreno97
Copy link
Contributor

Moreno97 commented Jan 11, 2018

Hey guys, you can check #2494 PR, it supports last React Native version.

@gvillenave
Copy link

Thanks @Moreno97, will try that locally. Hopefully we can get this merged soon!

@danilobuerger
Copy link
Collaborator

@Moreno97 your PR no longer seems to have any changes :(

@Moreno97
Copy link
Contributor

@danilobuerger I know, it was my fault, I put the code on the wrong branch and it was removed. I'm working on it.

@danilobuerger
Copy link
Collaborator

danilobuerger commented Jan 16, 2018

@Moreno97 since it's not going to get merged into v1 anyway, I will glady merge it into my fork here: https://github.com/feastr/react-native-navigation.

@Moreno97
Copy link
Contributor

It's finished @danilobuerger , check #2545 .

@danilobuerger
Copy link
Collaborator

@Moreno97 thanks, going to commit it to my fork.

@decodez
Copy link

decodez commented Jan 18, 2018

Any idea how to solve this issue with RN0.52 ?? I am still getting the same error during android build ?

@gabrieldavid98
Copy link

i have the same problem, i'm going to install RN 0.51 to check wether problem is beacause of version

@gabrieldavid98
Copy link

Yep, i've installed RN 0.51 and it goes good, it seems the problem is by using RN 0.52

@fabriziocacicia
Copy link

Same situation for me

@iCodePup
Copy link

+1

2 similar comments
@AliAlturbaq
Copy link

+1

@bmovement
Copy link

+1

@zen0wu
Copy link

zen0wu commented Jan 25, 2018

+1. It has been almost 3 weeks, could anyone take a look at the current PRs #2545 and #2580

@martincarrera
Copy link

+1 😢

@Flavien
Copy link

Flavien commented Jan 26, 2018

+1 😭

@rcpfuchs
Copy link

+1

@sttrider
Copy link

Any news?

@Tankerxyz
Copy link

wup wup, any ideas how to fix it?

@vishal-android-freak
Copy link

How about picking up PR changes and integrate it in your project rather than adding up +1s which provides no help and gives the OP unnecessary email notifications? If it's so urgent, JUST DO IT!

@rcpfuchs
Copy link

I just downgraded to 0.51 as the project page says it supports up to 0.51. Works.

@zen0wu
Copy link

zen0wu commented Jan 29, 2018

@vishal-android-freak Sorry for another unnecessary email notif. Even though I share your feelings, but I can only partially agree. I believe many people don't have the time/resource to do that, and also, patching the PR in many cases only validates things work in basic cases. I might not trust myself with a patched PR without battle tested functionality, and I might not want to push that change to my users, so it would be the best that the professionals - the wix team can prioritize this task. +1 is just a way for pushing prioritization.

@vishal-android-freak
Copy link

@shivawu while I completely get your point, if you go through the PR, one file has few changes to be done, THAT's IT! You can definitely go ahead with the changes on your side and wait for the official release till then. These changes are not something that are going make your build unstable 😅

@arapocket
Copy link

Well I'm looking through both pull requests and both of them seem to be giving some people some issues. It seems these changes are something that are going to make your build unstable 😌

@ericketts
Copy link
Contributor

ericketts commented Feb 6, 2018

@kk1429 is this good to close now that #2580 has been merged? that PR fixed my instance of the same build error.

@gvillenave
Copy link

I just upgraded to RN 0.53 and RNN 1.1.370 and everything works fine.

@stale
Copy link

stale bot commented Jun 2, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Jun 2, 2018
@guyca guyca removed the Help wanted label Jun 4, 2018
@stale stale bot removed the 🏚 stale label Jun 4, 2018
@davekedar
Copy link

@kk1429 @vishal-android-freak Did you guys solved it? I am facing the same issue with android

@stale
Copy link

stale bot commented Aug 2, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Aug 2, 2018
@stale
Copy link

stale bot commented Aug 9, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Aug 9, 2018
@zcmgyu
Copy link

zcmgyu commented May 31, 2019

Nobody :(

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

No branches or pull requests