Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

[Dúvida] Não consigo rodar o projeto

Oi, tudo bem? Depois de baixar o projeto novo e dar os comandos mostrados na aula (npm i e npm start), quando vou fazer o comando npm run android aparece o seguinte erro:

StStarting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details > Task :react-native-svg:generateDebugRFile FAILED 28 actionable tasks: 28 executed FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-svg:generateDebugRFile'. > Could not resolve all files for configuration ':react-native-svg:debugCompileClasspath'. > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}. > Execution failed for JetifyTransform: C:\Users\eduar.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native\0.71.0-rc.0\7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543\react-native-0.71.0-rc.0-debug.aar. > Java heap space * 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 24s 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

Alguem sabe o que eu posso estar fazendo de errado? O projeto das aulas passadas rodavam normalmente.

Obrigado! :)

2 respostas
solução!

Funcionou criando um projeto novo e passando as dependencias e o src para dentro dele

Eu tive esse erro e resolvi adicionando o repositorio jcenter() e adicionei um exclusiveContent, ai parou de dar esse erro abaixo meu build.glande utilizado nesta etapa do curso

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        exclusiveContent {
            // We get React Native's Android binaries exclusively through npm,
            // from a local Maven repo inside node_modules/react-native/.
            // (The use of exclusiveContent prevents looking elsewhere like Maven Central
            // and potentially getting a wrong version.)
            filter {
                includeGroup "com.facebook.react"
            }
            forRepository {
                maven {
                    url "$rootDir/../node_modules/react-native/android"
                }
            }
        }
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()

        maven { url 'https://www.jitpack.io' }
    }
}