3

I was in the middle of coding an app using VS Code and react-native and after trying to install react-native-material-ripple I ran into the following error trying to build my app:

/////////////////////////////////////////////////////////////////////////////////////////////// FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\D'errah\Documents\Code\React\dowProjectMatcher\node_modules\react-native-reanimated\android\build.gradle' line: 89

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

java.io.IOException: The filename, directory name, or volume label syntax is incorrect //////////////////////////////////////////////////////////////////////////////////////////////

The app was working perfectly before then. I went to the file in question and looked at the line the error mentioned:

mentioned line:

classpath += files(android.bootClasspath)

full file:

def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
    if (project == rootProject) {
        // The Android Gradle plugin is only required when opening the android folder stand-alone.
        // This avoids unnecessary downloads and potential conflicts when the library is included as a
        // module dependency in an application project.
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.2'
        }
    }
}

apply plugin: 'com.android.library'
apply plugin: 'maven'

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 28)
    buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        targetSdkVersion safeExtGet('targetSdkVersion', 28)
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    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()
}

dependencies {
    //noinspection GradleDynamicVersion
    implementation 'com.facebook.react:react-native:+'  // From node_modules
    implementation "androidx.transition:transition:1.1.0"
}

def configureReactNativePom(def pom) {
    def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)

    pom.project {
        name packageJson.title
        artifactId packageJson.name
        version = packageJson.version
        group = "com.swmansion.reanimated"
        description packageJson.description
        url packageJson.repository.baseUrl

        licenses {
            license {
                name packageJson.license
                url packageJson.repository.baseUrl + '/blob/master/' + packageJson.licenseFilename
                distribution 'repo'
            }
        }

        developers {
            developer {
                id packageJson.author.username
                name packageJson.author.name
            }
        }
    }
}

afterEvaluate { project ->

    task androidJavadoc(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += files(android.bootClasspath)
        classpath += files(project.getConfigurations().getByName('compile').asList())
        include '**/*.java'
    }

    task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
        classifier = 'javadoc'
        from androidJavadoc.destinationDir
    }

    task androidSourcesJar(type: Jar) {
        classifier = 'sources'
        from android.sourceSets.main.java.srcDirs
        include '**/*.java'
    }

    android.libraryVariants.all { variant ->
        def compileTask
        if (variant.hasProperty('javaCompileProvider')){
            compileTask = variant.javaCompileProvider.get()
        }else{
            compileTask = variant.javaCompile
        }

        def name = variant.name.capitalize()
        task "jar${name}"(type: Jar, dependsOn: compileTask) {
            from compileTask.destinationDir
        }
    }

    artifacts {
        archives androidSourcesJar
        archives androidJavadocJar
    }

    task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.mavenDeployer {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"

            configureReactNativePom pom
        }
    }
}

The problem is, I'm pretty sure that how that line was already even while the app was working. So I've spent the last few hours googling and haven't been able to figure out what cause the issue/how to fix it.

Any help would be GREATLY appreciated!

Things to note:

-using VS Code

-Was working before installing react-native-material-ripple (tried uninstalling, test, reinstalling, test)

D'errah
  • 29
  • 1
  • 4
  • Did you figure this out. I am wondering if it is related to my error at all https://stackoverflow.com/questions/64090671/local-build-success-circleci-fail-on-task-react-native-reanimatedandroidjavad – Dean Hiller Sep 27 '20 at 16:24
  • I shut off my laptop and restarted windows and then the app worked with no changes. – D'errah Sep 29 '20 at 19:36

1 Answers1

-1

Same error occurred for me also, please go through this documentation for proper installation setup for react-native-reanimate.

Install latest

yarn add react-native-reanimated@next

or

npm i react-native-reanimated@next

now go to android dir and gradlew clean, for more details go through below link

https://docs.swmansion.com/react-native-reanimated/docs/installation

keerthi c
  • 51
  • 7