2

I have a complete react native environment on my iMac, the project run completely when i run react-native run-ios, but when i'll do this with android it doesn't work, metro bundler window opens but doesn't work and don't appear any message.

What i have to do?

My terminal after i run "react-native run-android"

Daives-iMac:generico_toaqui_app fourtime$ react-native run-android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-code-push: https://microsoft.github.io/code-push
  - react-native-maps: https://github.com/react-native-community/react-native-maps#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: 
  - @react-native-community/netinfo (to unlink run: "react-native unlink @react-native-community/netinfo")
  - bugsnag-react-native (to unlink run: "react-native unlink bugsnag-react-native")
  - react-native-camera (to unlink run: "react-native unlink react-native-camera")
  - react-native-code-push (to unlink run: "react-native unlink react-native-code-push")
  - react-native-contacts (to unlink run: "react-native unlink react-native-contacts")
  - react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
  - react-native-firebase (to unlink run: "react-native unlink react-native-firebase")
  - react-native-fs (to unlink run: "react-native unlink react-native-fs")
  - react-native-image-picker (to unlink run: "react-native unlink react-native-image-picker")
  - react-native-image-resizer (to unlink run: "react-native unlink react-native-image-resizer")
  - react-native-maps (to unlink run: "react-native unlink react-native-maps")
  - react-native-otp-verify (to unlink run: "react-native unlink react-native-otp-verify")
  - react-native-power-saving-mode (to unlink run: "react-native unlink react-native-power-saving-mode")
  - react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
  - rethink-gpstracking (to unlink run: "react-native unlink rethink-gpstracking")
  - rethink-material-design (to unlink run: "react-native unlink rethink-material-design")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1891 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details

> Configure project :app
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/releaseStaging, src/releaseStaging/nullnull, src/nullnull, src/releaseStaging, src/nullnullReleaseStaging]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from /Users/fourtime/Documents/React Native/generico_toaqui_app/node_modules/react-native/android

> Configure project :react-native-image-resizer
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-power-saving-mode
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :rethink-gpstracking
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :rethink-material-design
WARNING: The following project options are deprecated and have been removed: 
android.useDeprecatedNdk
NdkCompile is no longer supported


WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :rethink-utils
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (26.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (23.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:processDebugGoogleServices
Parsing json file: /Users/fourtime/Documents/React Native/generico_toaqui_app/android/app/google-services.json

> Task :app:processDebugManifest
/Users/fourtime/Documents/React Native/generico_toaqui_app/android/app/src/debug/AndroidManifest.xml:24:9-31:50 Warning:
        activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present

> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.

> Task :app:installDebug
04:58:49 V/ddms: execute: running am get-config
04:58:50 V/ddms: execute 'am get-config' on 'S541008694' : EOF hit. Read: -1
04:58:50 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Twist 2 Go - 8.1.0' for app:debug
04:58:50 D/app-debug.apk: Uploading app-debug.apk onto device 'S541008694'
04:58:50 D/Device: Uploading file onto device 'S541008694'
04:58:50 D/ddms: Reading file permision of /Users/fourtime/Documents/React Native/generico_toaqui_app/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
04:58:52 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
04:59:07 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'S541008694' : EOF hit. Read: -1
04:59:07 V/ddms: execute: returning
04:59:07 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
04:59:08 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'S541008694' : EOF hit. Read: -1
04:59:08 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2m 2s
485 actionable tasks: 9 executed, 476 up-to-date
/bin/sh: adb: command not found
info Connecting to the development server...
warn Failed to connect to development server using "adb reverse": spawnSync adb ENOENT
info Starting the app...

My terminal's print screen after i run android and under it my metro bundler

  • can you provide more information? do you have installed Android Studio on your mac too? can you show us Terminal log after trying "react-native run-android"? – DNA.h Jan 30 '20 at 19:52
  • Yes, i have android studio on my mac. I copied my terminal and edited the question with the log. – Marcus Vinicius Jan 30 '20 at 20:07

3 Answers3

1

Looks likes you don't have the "NDK side by side" enabled per this error:

Compatible side by side NDK version was not found.

Open your Android Studio and install the "NDK (Side by side)" tool: Android Studio -> Tools -> SDK Manager -> SDK Tools

Then: react-native run-android

I hope this help.

Wils
  • 1,211
  • 17
  • 31
0

Did you try this Installing ADB on macOS ? After doing that make sure you're running the emulator before doing react-native run-android

  • I installed now and the emulator is running after. I don't know what i can do more. On ios all is working right, only on android are this stuck in all of projects that i initialize or i continue. – Marcus Vinicius Jan 31 '20 at 12:24
0

from the looks of it, I can sense two problems:

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:

since you are using RN 0.60 or above, it can automatically link certain libraries for you, you can safely unlink those mentioned libraries. Try a look at this

/bin/sh: adb: command not found

it seems adb command is not accessible to npm, for this one take a look at this

DNA.h
  • 823
  • 8
  • 17