title: How to solve error "Unable to find valid certification path to requested target while executing command react-native run-android"
body: <p>I'm totally new to React Native 
  I have created first project in React Native with the following commands:</p>
  
  <ol>
  <li>react-native init Hello</li>
  <li>cd Hello</li>
  <li>npm start</li>
  <li>react-native run-android</li>
  </ol>
  
  <p>But while executing <strong>"react-native run-android"</strong> I'm getting this error-</p>
  
  <p><a href="https://i.stack.imgur.com/Zrf37.png" rel="nofollow noreferrer">Error message screenshot</a></p>
  
  <p>Please help me out.</p>
  
  <pre><code>After more efforts this error was resolved but now getting another error
  
  Solutions which I have tried was:
  Solution 1:
  1. Open your project in Android Studio i.e. android folder of your react native project 
  2. Sync your project so that gradle.zip will download properly
  3. Then run your project.
  
  Solution 2:
  1. Open your React native project
  2. Navigate to android folder within it
  3. Go to gradle folder inside it 
  4. Open gradle-wrapper.properties
  5. And modify your distributionUrl from "https" to "http"
  6. Run your project
  
  But at the end another error was occurred which was mentioned below.
  
  &gt;react-native run-android
  info Starting JS server...
  info Building and installing the app on the device (cd android &amp;&amp; gradlew.bat ap
  p:installDebug)...
  Picked up _JAVA_OPTIONS: -Xmx1024M
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  A problem occurred configuring root project 'FirstApp'.
  &gt; Could not resolve all artifacts for configuration ':classpath'.
     &gt; Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21.
       Required by:
           project : &gt; com.android.tools.build:gradle:3.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.an
  alytics-library:shared:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.li
  nt:lint-gradle-api:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:gradle-api:3.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; androidx.databinding
  :databinding-compiler-common:3.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2 &gt; com.android.tools:sdk-common:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2 &gt; com.android.tools:common:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2 &gt; com.android.tools.build:manifest-merger:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2 &gt; com.android.tools.analytics-library:tracker:26.3.2
           project : &gt; com.android.tools.build:gradle:3.3.2 &gt; com.android.tools.bu
  ild:builder:3.3.2 &gt; com.android.tools:sdklib:26.3.2 &gt; com.android.tools:reposito
  ry:26.3.2
        &gt; Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21.
           &gt; Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kot
  lin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'.
              &gt; Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/ko
  tlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'.
                 &gt; sun.security.validator.ValidatorException: PKIX path building f
  ailed: sun.security.provider.certpath.SunCertPathBuilderException: unable to fin
  d valid certification path to requested target
        &gt; Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21.
           &gt; Could not get resource 'https://dl.google.com/dl/android/maven2/org/j
  etbrains/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'.
              &gt; Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrai
  ns/kotlin/kotlin-stdlib-jdk8/1.3.21/kotlin-stdlib-jdk8-1.3.21.pom'.
                 &gt; sun.security.validator.ValidatorException: PKIX path building f
  ailed: sun.security.provider.certpath.SunCertPathBuilderException: unable to fin
  d valid certification path to requested target
  
  * 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 13s
  error 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
  error Command failed: gradlew.bat app:installDebug
  </code></pre>
  
  <p>I'm executing my project in my phone I have checked that my device is properly connected or not with the command "adb devices". My device name was displayed. </p>
  
  <p>So I'm not understand what to do next.</p>
  
  <hr>
  
  <pre><code>I was trying to solve this error and got a solution which i have implemented 
  1. Open your react native project in android studio
  2. File -&gt; Settings -&gt; Remote Jar Repositories -&gt; Click on Add Button 
  3. Add maven Repository URL given below:
   https://mvnrepository.com/artifact/com.android.tools/sdklib
  4. Sync your project 
  Many error was gone. 
  </code></pre>
  
  <p>And just want help to solve these below mentioned errors:</p>
  
  <pre><code>* What went wrong:
  A problem occurred configuring root project 'FirstApp'.
  &gt; Could not resolve all artifacts for configuration ':classpath'.
     &gt; Could not download bcpkix-jdk15on.jar (org.bouncycastle:bcpkix-jdk15on:1.56
  )
        &gt; Could not get resource 'https://jcenter.bintray.com/org/bouncycastle/bcp
  kix-jdk15on/1.56/bcpkix-jdk15on-1.56.jar'.
           &gt; Could not HEAD 'https://jcenter.bintray.com/org/bouncycastle/bcpkix-j
  dk15on/1.56/bcpkix-jdk15on-1.56.jar'.
              &gt; sun.security.validator.ValidatorException: PKIX path building fail
  ed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find v
  alid certification path to requested target
  </code></pre>
  
  <p>Thanks in advance!</p>