Skip to content

react-native unable to build #18233

Closed
Closed
@JFE84

Description

@JFE84

I tried running the app on a physical device like I have been doing but I got this error and no idea how to solve it.

Environment

Environment:
OS: Linux 4.13
Node: 8.9.4
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: N/A
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.0 => 0.53.0

Expected Behavior

build in physical device (android phone) like I have been doing. This isn't a new project and it was working fine

Actual Behavior

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project '2hats'.

Could not resolve all files for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.0.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
Could not resolve com.android.tools.build:gradle:3.0.1.
Required by:
project : > com.google.firebase:firebase-plugins:1.1.5 > com.google.firebase:crash-plugin:1.1.5
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
> Could not resolve com.android.tools.build:gradle:3.0.1.
> Could not get resource 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> Could not GET 'https://maven.google.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
> java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

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

BUILD FAILED in 4s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Steps to Reproduce

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url "http://jcenter.bintray.com/" }
maven { url 'http://repo1.maven.org/maven2' }
maven { url 'https://maven.google.com' }
// maven { url "https://dl.google.com/dl/android/maven2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'

    // Adobe Creative SDK
    // classpath 'me.tatarka:gradle-    retrolambda:3.3.0-beta4'

    // Firebase push notification service
    classpath 'com.google.gms:google-services:3.2.0'

    // Firebase crash report
    classpath 'com.google.firebase:firebase-plugins:1.1.5'
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 26
                buildToolsVersion '26.0.2'
            }
        }
    }
}

}

allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven { url "http://jcenter.bintray.com/"}
maven { url 'http://repo1.maven.org/maven2' }
mavenCentral()
maven { url 'https://maven.google.com' }
// maven { url "https://dl.google.com/dl/android/maven2/" }
maven { url 'https://jitpack.io' }
maven { url 'http://maven.localytics.com/public' }
// maven {
// url 'https://repo.adobe.com/nexus/content/repositories/releases/'
// }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}

ext {
react = [
nodeExecutableAndArgs: ["/usr/local/bin/node"]
]
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions