Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native unable to build #18233

Closed
JFE84 opened this issue Mar 6, 2018 · 2 comments
Closed

react-native unable to build #18233

JFE84 opened this issue Mar 6, 2018 · 2 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@JFE84
Copy link

JFE84 commented Mar 6, 2018

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
}

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest stable release?

Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Old Version Ran Commands One of our bots successfully processed a command. labels Mar 7, 2018
@JFE84
Copy link
Author

JFE84 commented Mar 21, 2018

unable to build with latest version due to a different bug, I had to downgrade to 0.53.
Eventually fixed this after unlinking, uninstalling and reinstalling things. Sorry can't be specific because don't know exactly how I did it.

This is how it looks now

buildscript {
   repositories {
        maven  { url "http://jcenter.bintray.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 {
        mavenLocal()
        maven    { url "http://jcenter.bintray.com/"}
        mavenCentral()
        maven { url "https://dl.google.com/dl/android/maven2/" }
        maven { url 'https://jitpack.io' }
        maven {
            url 'http://maven.localytics.com/public'
        }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        google()
    }
}

@JFE84 JFE84 closed this as completed Mar 21, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Mar 21, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants