facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.43k stars 24.25k forks source link

Skipping device 'F-02F - 4.4.2' for 'app:debug': minSdkVersion [21] > deviceApiLevel [19] #29805

Closed seyedasfar closed 4 years ago

seyedasfar commented 4 years ago

Description

React Native app is not installing on tablet F-02F showing > Task :app:installDebug FAILED error but installed and running on Galaxy J7

Device Info

Build unsuccess on

Tablet Fujitsu Arrows Tab F-02F Andriod Version 4.4.2

Build success on

Samsung Galaxy J7 2016 Andriod Version 8.1.0

React Native version:

System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i3-2377M CPU @ 1.50GHz
    Memory: 7.35 GB / 11.80 GB
  Binaries:
    Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK:
      API Levels: 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.1
      System Images: android-27 | Google APIs Intel x86 Atom
      Android NDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Version  4.0.0.0 AI-193.6911.18.40.6626763
    Visual Studio: Not Found
  Languages:
    Java: 1.8.0_211 - C:\Program Files\Java\jdk1.8.0_211\bin\javac.EXE
    Python: 3.8.5 - C:\Python38\python.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
  npmGlobalPackages:
    *react-native*: Not Found

Conclusion

I think I get this error because my Tab F-02F Andriod version is too old but I need to test my app on a physical Android tab device.

Expected Results

Running on my Fujitsu Arrows Tab F-02F and Samsung J7 device

build.gradle

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21  
        compileSdkVersion = 29
        targetSdkVersion = 29
    }
    ...
}

Error

> Task :app:installDebug FAILED
Skipping device 'F-02F - 4.4.2' for 'app:debug': minSdkVersion [21] > deviceApiLevel [19]

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
488 actionable tasks: 2 executed, 486 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> Failed to install on any devices.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 12s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! adex@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the adex@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chawki\AppData\Roaming\npm-cache\_logs\2020-08-29T09_51_27_289Z-debug.log
gedeagas commented 4 years ago

HI, @usama-asfar thx for the issue but I don't think this is a react-native bug.

The minSdkVersion of your app is API Level 21 ( Android 5.0 ). Because you are trying to install the app on a device with Andriod Version 4.4.2 Gradle will skip your device because it's lower than Android 5.0.

Do your app use native modules that are dependant on android API level >= 21? if not you can try to lower your minSdkVersion to API Level 19 ( Android 4.4)

dulmandakh commented 4 years ago

Closing per @gedeagas comment. Thanks