2

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

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where: Build file 'E:\React_native\paperboy\node_modules\react-native-gesture-handler\android\build.gradle' line: 27

  • What went wrong: A problem occurred evaluating project ':react-native-gesture-handler'.

Could not initialize class org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt

  • 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. ==============================================================================

2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':react-native-gesture-handler'.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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. ==============================================================================

BUILD FAILED in 14s

at makeError (E:\React_native\paperboy\node_modules\execa\index.js:174:9)
at E:\React_native\paperboy\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (E:\React_native\paperboy\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (E:\React_native\paperboy\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details.

1
  • I am having the same issue, were you able to resolve it? Commented Jun 25, 2022 at 7:05

1 Answer 1

0

Try to remove the if..else condition in your build.gradle file under the signingConfigs > release. Example:

    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        release {
            storeFile file('xxx')
            storePassword 'xxx'
            keyAlias 'xxx'
            keyPassword 'xxx'
        }
    }
Sign up to request clarification or add additional context in comments.

1 Comment

there is no if..else in the signingconfig section. it looks exactly like your example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.