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 java.lang.IllegalAccessError Method void android.support.v4.net.ConnectivityManagerCompat #6152

Closed
tuneZola opened this Issue Feb 25, 2016 · 96 comments

Comments

Projects
None yet
@tuneZola

It appears that the NetInfo Module is trying to access ( com.facebook.react.modules.netinfo.NetInfoModule ) ConnectivityManagerCompat ( java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat ) method of android support lib v4 and that method is private?
java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat. I am using RN .18, so I am not sure if this is not an issue in RN .20, but I wanted to post it just incase someone else is running across this issue. Stack Trace 🎱

Also I do have the network permission in the manifest.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

02-25 10:51:50.355 23140-23174/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
                                                   Process: package.name, PID: 23140
                                                   java.lang.RuntimeException: An error occurred while executing doInBackground()
                                                       at android.os.AsyncTask$3.done(AsyncTask.java:307)
                                                       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
                                                       at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
                                                       at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                                                       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                       at java.lang.Thread.run(Thread.java:818)
                                                    Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule' (declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/app/package.name-2/base.apk)
                                                       at com.facebook.react.modules.netinfo.NetInfoModule.<init>(NetInfoModule.java:55)
                                                       at com.facebook.react.shell.MainReactPackage.createNativeModules(MainReactPackage.java:62)
                                                       at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:751)
                                                       at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:688)
                                                       at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:84)
                                                       at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:177)
                                                       at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:162)
                                                       at android.os.AsyncTask$2.call(AsyncTask.java:295)
                                                       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
                                                       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
                                                       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
                                                       at java.lang.Thread.run(Thread.java:818) ```
@Traviskn

This comment has been minimized.

Show comment
Hide comment
@Traviskn

Traviskn Feb 28, 2016

I am also hitting this error when I try to run my app on android. The app crashes right after fetching the js bundle. Running on iOS has no problems.

Even checking out older versions of my app that are deployed and working in production still does not fix the issue, I simply cannot run android! Strangely, one of my co-workers has no problems running android. Also, if I react-native init a brand new project it also has no problems running on android. I'm completely mystified as to what could be going on.

I've included logcat output if that helps. It appears to be hitting the same error as described by @tuneZola :

02-27 23:08:42.546  1721  1747 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
02-27 23:08:42.546  1721  1747 E AndroidRuntime: Process: com.chillinmobile, PID: 1721
02-27 23:08:42.546  1721  1747 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$3.done(AsyncTask.java:309)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:818)
02-27 23:08:42.546  1721  1747 E AndroidRuntime: Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule' (declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/app/com.chillinmobile-1/base.apk)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.modules.netinfo.NetInfoModule.<init>(NetInfoModule.java:55)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.shell.MainReactPackage.createNativeModules(MainReactPackage.java:67)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:793)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:730)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:91)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:184)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$2.call(AsyncTask.java:295)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    ... 4 more

I am also hitting this error when I try to run my app on android. The app crashes right after fetching the js bundle. Running on iOS has no problems.

Even checking out older versions of my app that are deployed and working in production still does not fix the issue, I simply cannot run android! Strangely, one of my co-workers has no problems running android. Also, if I react-native init a brand new project it also has no problems running on android. I'm completely mystified as to what could be going on.

I've included logcat output if that helps. It appears to be hitting the same error as described by @tuneZola :

02-27 23:08:42.546  1721  1747 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
02-27 23:08:42.546  1721  1747 E AndroidRuntime: Process: com.chillinmobile, PID: 1721
02-27 23:08:42.546  1721  1747 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$3.done(AsyncTask.java:309)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:818)
02-27 23:08:42.546  1721  1747 E AndroidRuntime: Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()' is inaccessible to class 'com.facebook.react.modules.netinfo.NetInfoModule' (declaration of 'com.facebook.react.modules.netinfo.NetInfoModule' appears in /data/app/com.chillinmobile-1/base.apk)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.modules.netinfo.NetInfoModule.<init>(NetInfoModule.java:55)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.shell.MainReactPackage.createNativeModules(MainReactPackage.java:67)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:793)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:730)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl.access$600(ReactInstanceManagerImpl.java:91)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:184)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at android.os.AsyncTask$2.call(AsyncTask.java:295)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
02-27 23:08:42.546  1721  1747 E AndroidRuntime:    ... 4 more
@ronanhardiman

This comment has been minimized.

Show comment
Hide comment
@ronanhardiman

ronanhardiman Feb 28, 2016

I am also hitting this error

I am also hitting this error

@pdiaz

This comment has been minimized.

Show comment
Hide comment
@pdiaz

pdiaz Feb 29, 2016

I found this issue only after I updated com.android.support:appcompat-v7 from 23.1.1 to 23.2.0 in app/build.gradle

pdiaz commented Feb 29, 2016

I found this issue only after I updated com.android.support:appcompat-v7 from 23.1.1 to 23.2.0 in app/build.gradle

@Traviskn

This comment has been minimized.

Show comment
Hide comment
@Traviskn

Traviskn Feb 29, 2016

@pdiaz Interesting! I had com.android.support:appcompat-v7:23.0.1 listed in my app/build.gradle dependencies. I tried updating that to 23.1.1 to see if that would help resolve my issue, but unfortunately I am still getting the crash caused by the IllegalAccessError

@pdiaz Interesting! I had com.android.support:appcompat-v7:23.0.1 listed in my app/build.gradle dependencies. I tried updating that to 23.1.1 to see if that would help resolve my issue, but unfortunately I am still getting the crash caused by the IllegalAccessError

@tuneZola

This comment has been minimized.

Show comment
Hide comment
@tuneZola

tuneZola Feb 29, 2016

@pdiaz I noticed that also with the support version update, but I didn't want to have a specific build version dependency. Most people have something like this in there dependency list "com.android.support:support-v4:23.+". Also, this is an issue that will start to show up for more people once they upgrade or use RN for the first time. Changing to a specific build version is just a temporary solution.

@pdiaz I noticed that also with the support version update, but I didn't want to have a specific build version dependency. Most people have something like this in there dependency list "com.android.support:support-v4:23.+". Also, this is an issue that will start to show up for more people once they upgrade or use RN for the first time. Changing to a specific build version is just a temporary solution.

@jinzhaoyu

This comment has been minimized.

Show comment
Hide comment
@jinzhaoyu

jinzhaoyu Mar 2, 2016

I has same problem when i upgrade android support package to 23.2

I has same problem when i upgrade android support package to 23.2

@gabygandrade

This comment has been minimized.

Show comment
Hide comment
@gabygandrade

gabygandrade Mar 2, 2016

+1 Tried with android support package v23.1 & v23.2

+1 Tried with android support package v23.1 & v23.2

@satya164

This comment has been minimized.

Show comment
Hide comment
@satya164

satya164 Mar 2, 2016

Collaborator
Collaborator

satya164 commented Mar 2, 2016

@Anthonyzou

This comment has been minimized.

Show comment
Hide comment
@Anthonyzou

Anthonyzou Mar 2, 2016

The issue is that the ConnectivityManagerCompat constructor is now private in version 23.2

The issue is that the ConnectivityManagerCompat constructor is now private in version 23.2

@bestander

This comment has been minimized.

Show comment
Hide comment
@bestander

bestander Mar 2, 2016

Contributor

Oh snap, I'll look into that tomorrow

Contributor

bestander commented Mar 2, 2016

Oh snap, I'll look into that tomorrow

@ceichinger

This comment has been minimized.

Show comment
Hide comment
@ceichinger

ceichinger Mar 3, 2016

+1 same issue here

+1 same issue here

@cedoucette

This comment has been minimized.

Show comment
Hide comment
@cedoucette

cedoucette Mar 3, 2016

+1 same issue here

+1 same issue here

@Traviskn

This comment has been minimized.

Show comment
Hide comment
@Traviskn

Traviskn Mar 3, 2016

Has anyone been able to fix the issue by changing their version of the android support package? I cannot get around the issue no matter which version I use (23.0.1, 23.1, 23.2)

Traviskn commented Mar 3, 2016

Has anyone been able to fix the issue by changing their version of the android support package? I cannot get around the issue no matter which version I use (23.0.1, 23.1, 23.2)

@tuneZola

This comment has been minimized.

Show comment
Hide comment
@tuneZola

tuneZola Mar 3, 2016

@Traviskn No, I was not able to fix it either by specifying those earlier version. I did a gradle clean, but it still seems to import the new version. I think its because I have other dependencies like the FB SDK that always imports the latest.

tuneZola commented Mar 3, 2016

@Traviskn No, I was not able to fix it either by specifying those earlier version. I did a gradle clean, but it still seems to import the new version. I think its because I have other dependencies like the FB SDK that always imports the latest.

@Anthonyzou

This comment has been minimized.

Show comment
Hide comment
@Anthonyzou

Anthonyzou Mar 3, 2016

If you are using the react-native-dialogue module the material-dialogue dependency will not compile without support v23.2. (all their tags point to the latest commit).

If you are using the react-native-dialogue module the material-dialogue dependency will not compile without support v23.2. (all their tags point to the latest commit).

@Anthonyzou

This comment has been minimized.

Show comment
Hide comment
@Anthonyzou

Anthonyzou Mar 3, 2016

to property downgrade your support version download this https://dl-ssl.google.com/android/repository/support_r23.0.1.zip and extract it into $ANDROID_HOME/extras/android/support

to property downgrade your support version download this https://dl-ssl.google.com/android/repository/support_r23.0.1.zip and extract it into $ANDROID_HOME/extras/android/support

@tuneZola

This comment has been minimized.

Show comment
Hide comment
@tuneZola

tuneZola Mar 3, 2016

One temporary fix you can do is exclude the package from your other dependencies in your app/gradle.build. This is an example of ours.

dependencies {
    // INCLUDE THE SUPPORT VERSION YOU WANT TO USE
    compile "com.android.support:support-v4:23.0.1"
    // EXCLUDE IT FROM THE REST
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile ( project(':RNWebView') ) { exclude module: 'support-v4' }
    compile ( project(':Orientation') ) { exclude module: 'support-v4' } 
    compile ( project(':react-native-google-analytics-bridge') ) { exclude module: 'support-v4' }
    compile "com.facebook.react:react-native:0.18.+"
    compile ( "com.facebook.android:facebook-android-sdk:4.+" ) {
        exclude module: 'bolts-tasks'
        exclude module: 'bolts-applinks'
        exclude module: 'support-v4'
    }
}

You should be able to go to your android folder and run

./gradlew app:dependencies

and all of the support packages should be listed as version 23.0.1. You might have to be a clean before that.

tuneZola commented Mar 3, 2016

One temporary fix you can do is exclude the package from your other dependencies in your app/gradle.build. This is an example of ours.

dependencies {
    // INCLUDE THE SUPPORT VERSION YOU WANT TO USE
    compile "com.android.support:support-v4:23.0.1"
    // EXCLUDE IT FROM THE REST
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile ( project(':RNWebView') ) { exclude module: 'support-v4' }
    compile ( project(':Orientation') ) { exclude module: 'support-v4' } 
    compile ( project(':react-native-google-analytics-bridge') ) { exclude module: 'support-v4' }
    compile "com.facebook.react:react-native:0.18.+"
    compile ( "com.facebook.android:facebook-android-sdk:4.+" ) {
        exclude module: 'bolts-tasks'
        exclude module: 'bolts-applinks'
        exclude module: 'support-v4'
    }
}

You should be able to go to your android folder and run

./gradlew app:dependencies

and all of the support packages should be listed as version 23.0.1. You might have to be a clean before that.

@bestander

This comment has been minimized.

Show comment
Hide comment
@bestander

bestander Mar 4, 2016

Contributor

@Anthonyzou we don't instantiate ConnectivityManagerCompat, so constructor visibility should not make a difference.
But anyway, I am debugging this

Contributor

bestander commented Mar 4, 2016

@Anthonyzou we don't instantiate ConnectivityManagerCompat, so constructor visibility should not make a difference.
But anyway, I am debugging this

@bestander

This comment has been minimized.

Show comment
Hide comment
@bestander

bestander Mar 4, 2016

Contributor

Looks like it is a breaking change in android support library.
We don't have capacity to fix this right now, a Pull Request with a fix that would work both for 23.1 and 23.2 would be very much appreciated.
Otherwise please post / vote on it at https://productpains.com/product/react-native. This way the most important issues for the community get surfaced.

Contributor

bestander commented Mar 4, 2016

Looks like it is a breaking change in android support library.
We don't have capacity to fix this right now, a Pull Request with a fix that would work both for 23.1 and 23.2 would be very much appreciated.
Otherwise please post / vote on it at https://productpains.com/product/react-native. This way the most important issues for the community get surfaced.

@ben-manes

This comment has been minimized.

Show comment
Hide comment
@ben-manes

ben-manes Mar 5, 2016

Contributor

@tuneZola Using a resolutionStrategy is a cleaner approach to force the version across all sub-projects.

subprojects {
  configurations.all {
    resolutionStrategy {
      // https://github.com/facebook/react-native/issues/6152
      force 'com.android.support:support-v4:23.0.1'
    }
  }
}
Contributor

ben-manes commented Mar 5, 2016

@tuneZola Using a resolutionStrategy is a cleaner approach to force the version across all sub-projects.

subprojects {
  configurations.all {
    resolutionStrategy {
      // https://github.com/facebook/react-native/issues/6152
      force 'com.android.support:support-v4:23.0.1'
    }
  }
}
@astuetz

This comment has been minimized.

Show comment
Hide comment
@astuetz

astuetz Mar 7, 2016

Contributor

Should be fixed with 3640080

Contributor

astuetz commented Mar 7, 2016

Should be fixed with 3640080

@satya164

This comment has been minimized.

Show comment
Hide comment
@satya164

satya164 Mar 7, 2016

Collaborator

Closing based on @astuetz's comment. Let's reopen of its still not working

Collaborator

satya164 commented Mar 7, 2016

Closing based on @astuetz's comment. Let's reopen of its still not working

@Traviskn

This comment has been minimized.

Show comment
Hide comment
@Traviskn

Traviskn Mar 8, 2016

@astuetz @satya164 This is great news! Do you know what version of react native that fix will be available in?

Traviskn commented Mar 8, 2016

@astuetz @satya164 This is great news! Do you know what version of react native that fix will be available in?

@astuetz

This comment has been minimized.

Show comment
Hide comment
@astuetz

astuetz Mar 10, 2016

Contributor

@Traviskn It's fixed in 0.22.0-rc already :)

Contributor

astuetz commented Mar 10, 2016

@Traviskn It's fixed in 0.22.0-rc already :)

@astuetz

This comment has been minimized.

Show comment
Hide comment
@astuetz

astuetz Mar 10, 2016

Contributor

@knowbody I think the fix for this Android-specific bug should be included in the 0.22.0-rc release notes as well. (Although the commit message doesn't really sound like a major bugfix)

Contributor

astuetz commented Mar 10, 2016

@knowbody I think the fix for this Android-specific bug should be included in the 0.22.0-rc release notes as well. (Although the commit message doesn't really sound like a major bugfix)

@knowbody

This comment has been minimized.

Show comment
Hide comment
@knowbody

knowbody Mar 10, 2016

Contributor

@astuetz done

Contributor

knowbody commented Mar 10, 2016

@astuetz done

@astuetz

This comment has been minimized.

Show comment
Hide comment
@astuetz

astuetz Mar 10, 2016

Contributor

@knowbody thanks! :)

Contributor

astuetz commented Mar 10, 2016

@knowbody thanks! :)

@felipecsl

This comment has been minimized.

Show comment
Hide comment
@felipecsl

felipecsl Mar 19, 2016

Contributor

where can I find 0.22-rc? Doesn't seem to be on maven central, jcenter or sonatype snapshots

Contributor

felipecsl commented Mar 19, 2016

where can I find 0.22-rc? Doesn't seem to be on maven central, jcenter or sonatype snapshots

@bestander

This comment has been minimized.

Show comment
Hide comment
@bestander

bestander Mar 19, 2016

Contributor

The jars are now included in the npm package.
just npm install react-native@0.22-rc4

Contributor

bestander commented Mar 19, 2016

The jars are now included in the npm package.
just npm install react-native@0.22-rc4

@felipecsl

This comment has been minimized.

Show comment
Hide comment
@felipecsl

felipecsl Mar 21, 2016

Contributor

thanks. btw the version is 0.22.0-rc4, I was able to use by copying it out from the android subdirectory into my local ~/.m2 maven repo

Contributor

felipecsl commented Mar 21, 2016

thanks. btw the version is 0.22.0-rc4, I was able to use by copying it out from the android subdirectory into my local ~/.m2 maven repo

@shraddha1704

This comment has been minimized.

Show comment
Hide comment
@shraddha1704

shraddha1704 Mar 21, 2016

I have upgraded to react-native@0.22.0-rc4. But I am still facing this issue.

I have upgraded to react-native@0.22.0-rc4. But I am still facing this issue.

@cedoucette

This comment has been minimized.

Show comment
Hide comment
@cedoucette

cedoucette Mar 21, 2016

The fix in react-native@0.22.0-rc4 worked for me. Thanks to whomever fixed it for the timely fix!

Sent from my iPhone

On Mar 21, 2016, at 4:01 AM, shraddha1704 <notifications@github.commailto:notifications@github.com> wrote:

I have upgraded to react-native@0.22.0-rc4mailto:react-native@0.22.0-rc4. But I am still facing this issue.

You are receiving this because you commented.
Reply to this email directly or view it on GitHubhttps://github.com/facebook/react-native/issues/6152#issuecomment-199163814

The fix in react-native@0.22.0-rc4 worked for me. Thanks to whomever fixed it for the timely fix!

Sent from my iPhone

On Mar 21, 2016, at 4:01 AM, shraddha1704 <notifications@github.commailto:notifications@github.com> wrote:

I have upgraded to react-native@0.22.0-rc4mailto:react-native@0.22.0-rc4. But I am still facing this issue.

You are receiving this because you commented.
Reply to this email directly or view it on GitHubhttps://github.com/facebook/react-native/issues/6152#issuecomment-199163814

@Kennytian

This comment has been minimized.

Show comment
Hide comment
@Kennytian

Kennytian Mar 24, 2016

com.android.support:appcompat-v7:23.2.1 change to com.android.support:appcompat-v7:23.0.1, fixed it

com.android.support:appcompat-v7:23.2.1 change to com.android.support:appcompat-v7:23.0.1, fixed it

@binqiangsun

This comment has been minimized.

Show comment
Hide comment
@binqiangsun

binqiangsun Mar 25, 2016

when intergrating with android project, only "compile 'com.facebook.react:react-native:0.20.+'" works.

when intergrating with android project, only "compile 'com.facebook.react:react-native:0.20.+'" works.

@sarajmunjal

This comment has been minimized.

Show comment
Hide comment
@sarajmunjal

sarajmunjal Apr 4, 2016

I'm on react-native@0.22.2, gradle dependency : 'com.facebook.react:react-native:0.20.+' and appcompat: 'com.android.support:appcompat-v7:23.2.0'. Still getting this error while trying to integrate into existing app.

I'm on react-native@0.22.2, gradle dependency : 'com.facebook.react:react-native:0.20.+' and appcompat: 'com.android.support:appcompat-v7:23.2.0'. Still getting this error while trying to integrate into existing app.

@jjding1986

This comment has been minimized.

Show comment
Hide comment

same issue as @sarajmunjal

@SandroMachado

This comment has been minimized.

Show comment
Hide comment
@SandroMachado

SandroMachado Oct 24, 2016

Contributor

Same here, one thing to help debug is specify the version in the build.gradle file when importing the React Native. Since the latest version are not in Maven central it will throw an error.

Contributor

SandroMachado commented Oct 24, 2016

Same here, one thing to help debug is specify the version in the build.gradle file when importing the React Native. Since the latest version are not in Maven central it will throw an error.

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 14, 2016

Contributor

I'm getting the exact same problem as @SandroMachado

Contributor

LiamInJapan commented Nov 14, 2016

I'm getting the exact same problem as @SandroMachado

@SandroMachado

This comment has been minimized.

Show comment
Hide comment
@SandroMachado

SandroMachado Nov 14, 2016

Contributor

@LiamInJapan did you try to specify the version in the app\build.gradle?

Contributor

SandroMachado commented Nov 14, 2016

@LiamInJapan did you try to specify the version in the app\build.gradle?

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 14, 2016

Contributor

android {
compileSdkVersion 23
buildToolsVersion "24.0.3"

defaultConfig {
    applicationId "xxxx"
    minSdkVersion 18
    targetSdkVersion 23
Contributor

LiamInJapan commented Nov 14, 2016

android {
compileSdkVersion 23
buildToolsVersion "24.0.3"

defaultConfig {
    applicationId "xxxx"
    minSdkVersion 18
    targetSdkVersion 23
@SandroMachado

This comment has been minimized.

Show comment
Hide comment
@SandroMachado

SandroMachado Nov 14, 2016

Contributor

Replace:

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

by

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.37"  // From node_modules
}
Contributor

SandroMachado commented Nov 14, 2016

Replace:

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

by

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.37"  // From node_modules
}
@ishan-dhingra

This comment has been minimized.

Show comment
Hide comment
@ishan-dhingra

ishan-dhingra Nov 15, 2016

@SandroMachado Below Change:

compile "com.facebook.react:react-native:0.37" // From node_modules

Not able to resolve dependency, here is the error:

Error:Failed to resolve: com.facebook.react:react-native:0.37

I am trying to integrate with existing project using v24 of support libs and downgrading libs is not an option.

@SandroMachado Below Change:

compile "com.facebook.react:react-native:0.37" // From node_modules

Not able to resolve dependency, here is the error:

Error:Failed to resolve: com.facebook.react:react-native:0.37

I am trying to integrate with existing project using v24 of support libs and downgrading libs is not an option.

@SandroMachado

This comment has been minimized.

Show comment
Hide comment
@SandroMachado

SandroMachado Nov 15, 2016

Contributor

@ishan-dhingra you find your issue. You are not importing React Native from the node_modules folder.

Make sure you defining the maven local repository folder correctly at you android/build.gradle:

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"
        }
    }
}
Contributor

SandroMachado commented Nov 15, 2016

@ishan-dhingra you find your issue. You are not importing React Native from the node_modules folder.

Make sure you defining the maven local repository folder correctly at you android/build.gradle:

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"
        }
    }
}
@ishan-dhingra

This comment has been minimized.

Show comment
Hide comment
@ishan-dhingra

ishan-dhingra Nov 16, 2016

@SandroMachado Thanks for quick response, I have this already in place.

Problem was with dependency version, it should be:

compile "com.facebook.react:react-native:0.37.0" // From node_modules

Notice the '.0'

@SandroMachado Thanks for quick response, I have this already in place.

Problem was with dependency version, it should be:

compile "com.facebook.react:react-native:0.37.0" // From node_modules

Notice the '.0'

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

Trying this now... Does this need any other changes in package.json. Mine looks like this:

"dependencies": {
    "react": "^0.14.8",
    "react-native": "^0.22.2"
  }

It does feel that if you maintained a table of relevant value sets somewhere, a lot of issues would be resolved (and the documentation would be a lot clearer)

Contributor

LiamInJapan commented Nov 16, 2016

Trying this now... Does this need any other changes in package.json. Mine looks like this:

"dependencies": {
    "react": "^0.14.8",
    "react-native": "^0.22.2"
  }

It does feel that if you maintained a table of relevant value sets somewhere, a lot of issues would be resolved (and the documentation would be a lot clearer)

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

This gives me a lot of compilation errors:

Error:(11, 26) error: cannot find symbol class LifecycleState
Error:(33, 34) error: cannot find symbol method onPause()
Error:(42, 34) error: cannot find symbol method onResume(ReactActivity,ReactActivity)
Error:(51, 34) error: cannot find symbol method onDestroy()
Error:(95, 43) error: cannot find symbol variable LifecycleState
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

Trying:

"dependencies": {
    "react": "^0.14.8",
    "react-native": "^0.37.0"
  }

followed by

rm -rf node_modules/ && npm install

Then a project refresh, then a build. I get the same errors.

Essentially, the process lined out in this doc is broken I believe... Unless maybe I need to update react version number too? (Which comes back to what I was saying earlier about a table of compatible version numbers)

Contributor

LiamInJapan commented Nov 16, 2016

This gives me a lot of compilation errors:

Error:(11, 26) error: cannot find symbol class LifecycleState
Error:(33, 34) error: cannot find symbol method onPause()
Error:(42, 34) error: cannot find symbol method onResume(ReactActivity,ReactActivity)
Error:(51, 34) error: cannot find symbol method onDestroy()
Error:(95, 43) error: cannot find symbol variable LifecycleState
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

Trying:

"dependencies": {
    "react": "^0.14.8",
    "react-native": "^0.37.0"
  }

followed by

rm -rf node_modules/ && npm install

Then a project refresh, then a build. I get the same errors.

Essentially, the process lined out in this doc is broken I believe... Unless maybe I need to update react version number too? (Which comes back to what I was saying earlier about a table of compatible version numbers)

@ishan-dhingra

This comment has been minimized.

Show comment
Hide comment
@ishan-dhingra

ishan-dhingra Nov 16, 2016

@LiamInJapan New package name for LifecycleState class: com.facebook.react.common.LifecycleState

@LiamInJapan New package name for LifecycleState class: com.facebook.react.common.LifecycleState

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

Thanks @ishan-dhingra

I still have these:

Error:(33, 34) error: cannot find symbol method onPause()
Error:(42, 34) error: cannot find symbol method onResume(ReactActivity,ReactActivity)
Error:(51, 34) error: cannot find symbol method onDestroy()
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

Contributor

LiamInJapan commented Nov 16, 2016

Thanks @ishan-dhingra

I still have these:

Error:(33, 34) error: cannot find symbol method onPause()
Error:(42, 34) error: cannot find symbol method onResume(ReactActivity,ReactActivity)
Error:(51, 34) error: cannot find symbol method onDestroy()
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

@ishan-dhingra

This comment has been minimized.

Show comment
Hide comment
@ishan-dhingra

ishan-dhingra Nov 16, 2016

@LiamInJapan This seems to be a Compile time Java error, check if you are extending class and overriding function properly.

@LiamInJapan This seems to be a Compile time Java error, check if you are extending class and overriding function properly.

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

Ok, I'll check (although this is what is in the documents... Actually come
to think of it I think I know what it is)

On Wed, Nov 16, 2016 at 6:26 PM, Ishan Dhingra notifications@github.com
wrote:

@LiamInJapan https://github.com/LiamInJapan This seems to be a Compile
time Java error, check if you are extending class and overriding function
properly.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6152 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABlM9y5Jjw-25LxmDODzomMkRKwTSAfXks5q-sxTgaJpZM4HjE37
.

Liam Conroy
Freelance Software Engineer
Portfolio http://liaminjapan.github.io
Twitter https://twitter.com/LiamInJapan
LinkedIn https://jp.linkedin.com/in/liamconroy2008
AngelList https://angel.co/liam-conroy

Contributor

LiamInJapan commented Nov 16, 2016

Ok, I'll check (although this is what is in the documents... Actually come
to think of it I think I know what it is)

On Wed, Nov 16, 2016 at 6:26 PM, Ishan Dhingra notifications@github.com
wrote:

@LiamInJapan https://github.com/LiamInJapan This seems to be a Compile
time Java error, check if you are extending class and overriding function
properly.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6152 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABlM9y5Jjw-25LxmDODzomMkRKwTSAfXks5q-sxTgaJpZM4HjE37
.

Liam Conroy
Freelance Software Engineer
Portfolio http://liaminjapan.github.io
Twitter https://twitter.com/LiamInJapan
LinkedIn https://jp.linkedin.com/in/liamconroy2008
AngelList https://angel.co/liam-conroy

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

So replacing with onHostPause, onHostResume e.t.c. gets it compiling, though there is a strikethrough on these function names (deprecated?).

Then I get a "Seem's you're trying to access 'ReactNative.Component' from the 'react-native' package "throwOnWrongReactAPI" exception...

Again these are using samples from the documentation... I am following the instructions now

Contributor

LiamInJapan commented Nov 16, 2016

So replacing with onHostPause, onHostResume e.t.c. gets it compiling, though there is a strikethrough on these function names (deprecated?).

Then I get a "Seem's you're trying to access 'ReactNative.Component' from the 'react-native' package "throwOnWrongReactAPI" exception...

Again these are using samples from the documentation... I am following the instructions now

@LiamInJapan

This comment has been minimized.

Show comment
Hide comment
@LiamInJapan

LiamInJapan Nov 16, 2016

Contributor

Ok I am finally at Hello World, though I think this is the longest "Hello World" I've ever experienced.

I still have the depreciated issue mind regarding the onHostXXXX functions (onDestroy e.t.c. don't work) which makes me think I still have a versioning issue:

"dependencies": {
    "react": "^15.3.2",
    "react-native": "^0.37.0"
  }
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.react:react-native:0.37.0'

Any advice appreciated!

Contributor

LiamInJapan commented Nov 16, 2016

Ok I am finally at Hello World, though I think this is the longest "Hello World" I've ever experienced.

I still have the depreciated issue mind regarding the onHostXXXX functions (onDestroy e.t.c. don't work) which makes me think I still have a versioning issue:

"dependencies": {
    "react": "^15.3.2",
    "react-native": "^0.37.0"
  }
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.react:react-native:0.37.0'

Any advice appreciated!

@HannanShaik

This comment has been minimized.

Show comment
Hide comment
@HannanShaik

HannanShaik Nov 18, 2016

I am facing the same issue. Can someone help?

I am facing the same issue. Can someone help?

@StefanoCremona

This comment has been minimized.

Show comment
Hide comment
@StefanoCremona

StefanoCremona Nov 22, 2016

I've solved the problem changing In my project's build.gradle file what follows
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
in
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "/MyAbsolutePathToTheApplicationRoot/node_modules/react-native/android"
}

Then you have to solve some compiling errors related to the OnPause, OnResume...that are changed in onHostPause, onHostResume and that's it. A pain in the ass anyway!

StefanoCremona commented Nov 22, 2016

I've solved the problem changing In my project's build.gradle file what follows
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
in
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "/MyAbsolutePathToTheApplicationRoot/node_modules/react-native/android"
}

Then you have to solve some compiling errors related to the OnPause, OnResume...that are changed in onHostPause, onHostResume and that's it. A pain in the ass anyway!

@HannanShaik

This comment has been minimized.

Show comment
Hide comment
@HannanShaik

HannanShaik Dec 12, 2016

@StefanoCremona I was able to get rid of the error with this, however when I run the app I get

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server.

I did this adb reverse tcp:8081 tcp:8081, even then it's not working. Did you come across this?

@StefanoCremona I was able to get rid of the error with this, however when I run the app I get

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server.

I did this adb reverse tcp:8081 tcp:8081, even then it's not working. Did you come across this?

@NoTraceOfSnow

This comment has been minimized.

Show comment
Hide comment

84m gp 2jp 93x 8v j 01
4ppwom_55zrsl2 zf241peu
no a39cfq6tu 1 3 8 h72m
l rot rolzttbaj 3bc0

@Jusenr

This comment has been minimized.

Show comment
Hide comment
@Jusenr

Jusenr Feb 9, 2017

"dependencies": { "react": "^0.14.7", "react-native": "^0.26.2" }

02-09 19:44:03.409 12389-12475/com.kenny.embedded E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.kenny.embedded, PID: 12389 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:321) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:833) Caused by: java.lang.UnsatisfiedLinkError: could find DSO to load: libreactnativejni.so at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178) at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:25) at com.facebook.react.bridge.JSCJavaScriptExecutor$Factory.create(JSCJavaScriptExecutor.java:20) at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:183) at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169) at android.os.AsyncTask$2.call(AsyncTask.java:307) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:833) 

Excuse me? Thank you !

Jusenr commented Feb 9, 2017

"dependencies": { "react": "^0.14.7", "react-native": "^0.26.2" }

02-09 19:44:03.409 12389-12475/com.kenny.embedded E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.kenny.embedded, PID: 12389 java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:321) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:833) Caused by: java.lang.UnsatisfiedLinkError: could find DSO to load: libreactnativejni.so at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213) at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178) at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:25) at com.facebook.react.bridge.JSCJavaScriptExecutor$Factory.create(JSCJavaScriptExecutor.java:20) at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:183) at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:169) at android.os.AsyncTask$2.call(AsyncTask.java:307) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:246)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:833) 

Excuse me? Thank you !

@sharjeel-ahmed

This comment has been minimized.

Show comment
Hide comment
@sharjeel-ahmed

sharjeel-ahmed Feb 9, 2017

I solved this problem by using the complete maven path in the app's build.gradle.

I had put this maven path in the Projects build.gradle before by mistake. Putting it into app's build.gradle worked.

I solved this problem by using the complete maven path in the app's build.gradle.

I had put this maven path in the Projects build.gradle before by mistake. Putting it into app's build.gradle worked.

@Jakevin

This comment has been minimized.

Show comment
Hide comment
@Jakevin

Jakevin Feb 10, 2017

I am also hitting this error

app gradle

 compileSdkVersion = 25
 buildToolsVersion = "24.0.3"
 compile 'com.android.support:appcompat-v7:23.0.1'
 complie 'com.android.support:support-v4:23.0.1'
 compile "com.facebook.react:react-native:+" // From node_modules.

package.json

"dependencies": {
    "react": "^15.4.2",
    "react-native": "^0.41.0"
  }

Jakevin commented Feb 10, 2017

I am also hitting this error

app gradle

 compileSdkVersion = 25
 buildToolsVersion = "24.0.3"
 compile 'com.android.support:appcompat-v7:23.0.1'
 complie 'com.android.support:support-v4:23.0.1'
 compile "com.facebook.react:react-native:+" // From node_modules.

package.json

"dependencies": {
    "react": "^15.4.2",
    "react-native": "^0.41.0"
  }
@NoTraceOfSnow

This comment has been minimized.

Show comment
Hide comment
@NoTraceOfSnow

NoTraceOfSnow Feb 10, 2017

keep the supportV7 version with the compileSdkVersion version

keep the supportV7 version with the compileSdkVersion version

@alexblack

This comment has been minimized.

Show comment
Hide comment
@alexblack

alexblack Feb 18, 2017

I'm hitting this with React Native 0.41.2, I don't have a appcompat-v4 dependency in my build.gradle file, I do have:

compile 'com.android.support:appcompat-v7:23.3.0'

ah, but one of my dependencies uses:

compile 'com.android.support:support-v4:22.2.1'

alexblack commented Feb 18, 2017

I'm hitting this with React Native 0.41.2, I don't have a appcompat-v4 dependency in my build.gradle file, I do have:

compile 'com.android.support:appcompat-v7:23.3.0'

ah, but one of my dependencies uses:

compile 'com.android.support:support-v4:22.2.1'

@haemi

This comment has been minimized.

Show comment
Hide comment
@haemi

haemi Feb 21, 2017

@NoTraceOfSnow I can't implement ReactApplication as it is not found - using compile "com.facebook.react:react-native:+" // From node_modules.

Am I missing something?

"dependencies": {
    "react": "^15.4.2",
    "react-native": "^0.41.2"
}

compileSdkVersion 25
buildToolsVersion "24.0.3"

compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'

haemi commented Feb 21, 2017

@NoTraceOfSnow I can't implement ReactApplication as it is not found - using compile "com.facebook.react:react-native:+" // From node_modules.

Am I missing something?

"dependencies": {
    "react": "^15.4.2",
    "react-native": "^0.41.2"
}

compileSdkVersion 25
buildToolsVersion "24.0.3"

compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
@NoTraceOfSnow

This comment has been minimized.

Show comment
Hide comment
@NoTraceOfSnow

NoTraceOfSnow Feb 21, 2017

@haemi your project has download this about the reactnative file? i have a good idea ,you can init a Official project ,View all files and you can find difference in the project,copy the difference file to you self project.if you can improt reactnative in you project you can link me , i will try my beast .my QQ email 2371479117@qq.com and you project has this picture files
1487663126 1

@haemi your project has download this about the reactnative file? i have a good idea ,you can init a Official project ,View all files and you can find difference in the project,copy the difference file to you self project.if you can improt reactnative in you project you can link me , i will try my beast .my QQ email 2371479117@qq.com and you project has this picture files
1487663126 1

@haemi

This comment has been minimized.

Show comment
Hide comment
@haemi

haemi Feb 21, 2017

@NoTraceOfSnow thanks for your quick response! I can import React into my project, I also have the node_modules folder with it's subfolders. But when I want to show my ReactNative-Activity, I get the error from above (java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()').

Then I wanted to try what you wrote here (#6152 (comment)), but I can't do the implements ReactApplication...

haemi commented Feb 21, 2017

@NoTraceOfSnow thanks for your quick response! I can import React into my project, I also have the node_modules folder with it's subfolders. But when I want to show my ReactNative-Activity, I get the error from above (java.lang.IllegalAccessError: Method 'void android.support.v4.net.ConnectivityManagerCompat.<init>()').

Then I wanted to try what you wrote here (#6152 (comment)), but I can't do the implements ReactApplication...

@NoTraceOfSnow

This comment has been minimized.

Show comment
Hide comment
@NoTraceOfSnow

NoTraceOfSnow Feb 21, 2017

@haemi eee.... do you start your server? and i think you lost some file .
fng1eayuw2s9x 9ds 7 6 gthis is the office project ,i think you can see the office project file one by one.wish you success

@haemi eee.... do you start your server? and i think you lost some file .
fng1eayuw2s9x 9ds 7 6 gthis is the office project ,i think you can see the office project file one by one.wish you success

@haemi

This comment has been minimized.

Show comment
Hide comment
@haemi

haemi Feb 21, 2017

is this in build.gradle correct?

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

shouldn't it be ReactAndroid at the end? I do not have a react-native/android directory...

haemi commented Feb 21, 2017

is this in build.gradle correct?

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

shouldn't it be ReactAndroid at the end? I do not have a react-native/android directory...

@NoTraceOfSnow

This comment has been minimized.

Show comment
Hide comment
@NoTraceOfSnow

NoTraceOfSnow Feb 22, 2017

so sorry i am sleep last night ,yes,you should it be . i will tell you how to lead reactnative into your project.
first
second
you should find the data.txt with you appgridle diffrence and copy in you project
data.txt
and you must keep version like this picture
third
foru
Wish you success

so sorry i am sleep last night ,yes,you should it be . i will tell you how to lead reactnative into your project.
first
second
you should find the data.txt with you appgridle diffrence and copy in you project
data.txt
and you must keep version like this picture
third
foru
Wish you success

@paolomaffei

This comment has been minimized.

Show comment
Hide comment
@paolomaffei

paolomaffei Jun 27, 2017

I suspect this is caused by gradle picking up the wrong version of react-native,
see PR here: #14743

I suspect this is caused by gradle picking up the wrong version of react-native,
see PR here: #14743

@hramos hramos added Help Wanted :octocat: and removed Help Wanted :octocat: labels Mar 8, 2018

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.