Issue in React Native Android build

When trying to build Android I am receiving this error:

/node_modules/@cometchat-pro/react-native-calls/android/build.gradle

  • What went wrong:
    A problem occurred configuring project ‘:cometchat-pro_react-native-calls’.

No such property: username for class: java.lang.String

Found the error,

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.reactlibrary"
    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
        }
    }
}

}

I removed the developers object. It was looking for username in the packageJson

For a permeant fix the package needs to have package.json updated:

“author”: {
“username”: “AuthorUserName”,
“name”: “AutherName”
},

I was going to make a pull request but the github page wasn’t loading.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.