Gradle sync failed: Could not GET https://jcenter.bintray.com - kotlin

I created a Kotlin application according to JetBrains's tutorial in the following link. But I encountered the build failed error. what is wrong?
https://www.jetbrains.com/help/idea/create-your-first-kotlin-app.html?section=Gradle%20Groovy
These are my screenshots:
and the entire build log is:
Starting Gradle Daemon...
Gradle Daemon started in 1 s 83 ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'hello'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin-api/1.7.21/kotlin-gradle-plugin-api-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-api/1.7.21/kotlin-gradle-plugin-api-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin-api/1.7.21/kotlin-gradle-plugin-api-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-api/1.7.21/kotlin-gradle-plugin-api-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin-model/1.7.21/kotlin-gradle-plugin-model-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-model/1.7.21/kotlin-gradle-plugin-model-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-tooling-core:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-tooling-core:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-tooling-core/1.7.21/kotlin-tooling-core-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-tooling-core/1.7.21/kotlin-tooling-core-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/1.7.21/kotlin-gradle-plugin-idea-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-idea/1.7.21/kotlin-gradle-plugin-idea-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-gradle-plugin-idea-proto/1.7.21/kotlin-gradle-plugin-idea-proto-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-idea-proto/1.7.21/kotlin-gradle-plugin-idea-proto-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-util-klib:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-util-klib:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-util-klib/1.7.21/kotlin-util-klib-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-util-klib/1.7.21/kotlin-util-klib-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-klib-commonizer-api/1.7.21/kotlin-klib-commonizer-api-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-klib-commonizer-api/1.7.21/kotlin-klib-commonizer-api-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-project-model:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-project-model:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-project-model/1.7.21/kotlin-project-model-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-project-model/1.7.21/kotlin-project-model-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-compiler-embeddable:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.7.21/kotlin-compiler-embeddable-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.7.21/kotlin-compiler-embeddable-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-annotation-processing-gradle/1.7.21/kotlin-annotation-processing-gradle-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-annotation-processing-gradle/1.7.21/kotlin-annotation-processing-gradle-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-android-extensions:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-android-extensions:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-android-extensions/1.7.21/kotlin-android-extensions-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-android-extensions/1.7.21/kotlin-android-extensions-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-compiler-runner:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-compiler-runner:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-compiler-runner/1.7.21/kotlin-compiler-runner-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-runner/1.7.21/kotlin-compiler-runner-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-scripting-compiler-embeddable/1.7.21/kotlin-scripting-compiler-embeddable-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-scripting-compiler-embeddable/1.7.21/kotlin-scripting-compiler-embeddable-1.7.21.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.21.
Required by:
project : > org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.7.21 > org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21
> Could not resolve org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.7.21.
> Could not get resource 'https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-scripting-compiler-impl-embeddable/1.7.21/kotlin-scripting-compiler-impl-embeddable-1.7.21.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-scripting-compiler-impl-embeddable/1.7.21/kotlin-scripting-compiler-impl-embeddable-1.7.21.pom'. Received status code 403 from server: Forbidden
* 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 7s

You can update your IntelliJ IDEA to the newest version and recreate a project.
You can also remove the jcenter() usage from your build.gradle and settings.gradle.
Reason:
Your Gradle log says
Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin-api/1.7.21/kotlin-gradle-plugin-api-1.7.21.pom'. Received status code 403 from server: Forbidden
which means it was trying to download Kotlin from JCenter. However, JCenter had stopped their service on May 1st 2021.
Kotlin is also available on Maven Central. It is encouraged to use Maven Central.
Newer IntelliJ would generate projects using Maven Central by default.
For you, I guess you are using an old IntelliJ IDEA, or an old Kotlin or Gradle plugin.
Why can't Gradle fallback to Maven Central?
When you declare multiple repositories, Gradle will try them one by one. If one repository returned 404 Not Found, Gradle attempts other repositories, which sounds good. But if Gradle receives an error from a repository, like in your case, it throws an exception complaining about that and crashes the build.

Related

Could not resolve phonepe.intentsdk.android.release

I am using version 2.1.0 of payu-non-seam-less-react,
after installation, it shows me the 403 from the server. I am not able to run the app ...
Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
Could not download IntentSDK-0.1.5.4.aar (phonepe.intentsdk.android.release:IntentSDK:0.1.5.4)
> Could not get resource 'https://phonepe.bintray.com/PhonePeIntentSDK/phonepe/intentsdk/android/release/IntentSDK/0.1.5.4/IntentSDK-0.1.5.4.aar'.
> Could not GET 'https://phonepe.bintray.com/PhonePeIntentSDK/phonepe/intentsdk/android/release/IntentSDK/0.1.5.4/IntentSDK-0.1.5.4.aar'. Received status code 403 from server: Forbidden

Could not resolve all artifacts for configuration ':classpath'. and error Received status code 403 from server: Forbidden in https://jcenter

After updating Gradle to 6.8.3, running my react-native app shows this error:
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.61/kotlin-gradle-plugin-1.3.61.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.61/kotlin-gradle-plugin-1.3.61.pom'. Received status code 403 from server: Forbidden
> Could not resolve com.android.tools.build:gradle:3.5.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.5.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'. Received status code 403 from server: Forbidden
* 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

" unable to find valid certification path to requested target" android studio

I have been struggling with this error for a long time and still could not find a solution to it. I have installed android studio 4 on Ubuntu 16.04.6 LTS. I am connected to the internet behind a proxy. I googgled it and set the configuration, but with no luck.
Any help is appricated. Find below the error exception.
Thank you in advance.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'RALAPP5'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:2.3.3.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.3.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.android.tools.build:gradle:2.3.3.
> Could not get resource 'http://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'.
> Could not GET 'http://jcenter.bintray.com/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom'. Received status code 403 from server: Forbidden
Could not resolve com.google.gms:google-services:3.0.0.
Required by:
project :
> Could not resolve com.google.gms:google-services:3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.gms:google-services:3.0.0.
> Could not get resource 'http://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom'.
> Could not GET 'http://jcenter.bintray.com/com/google/gms/google-services/3.0.0/google-services-3.0.0.pom'. Received status code 403 from server: Forbidden
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'RALAPP5'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:75)
at
Get more help at https://help.gradle.org
BUILD FAILED in 876ms
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

The package i have installed does not work. (https://www.npmjs.com/package/rn-sunmi-inner-printer)

I am having build issue after installing this package:
https://www.npmjs.com/package/rn-sunmi-inner-printer
Anybody know why does the java stops at line 442?
Why does the compilation failed?
> info Running jetifier to migrate libraries to AndroidX. You can
> disable it using "--no-jetifier" flag. Jetifier found 978 file(s) to
> forward-jetify. Using 4 workers... info Starting JS server... info
> Installing the app...
>
> > Configure project :rn-sunmi-inner-printer WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and
> 'api'. It will be removed soon. For more information see:
> http://d.android.com/r/tools/update-dependency-configurations.html
>
> > Task :rn-sunmi-inner-printer:compileDebugAidl
>
> > Task :rn-sunmi-inner-printer:compileDebugJavaWithJavac FAILED
>
> Deprecated Gradle features were used in this build, making it
> incompatible with Gradle 7.0. Use '--warning-mode all' to show the
> individual deprecation warnings. See
> https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
> 16 actionable tasks: 11 executed, 5 up-to-date aidl.exe E 07-17
> 09:57:43 2252 6336 aidl.cpp:581] refusing to generate code from aidl
> file defining parcelable
>
> C:\Users\User\Documents\Me\codes\AwesomeProject100\node_modules\rn-sunmi-inner-printer\android\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\woyou\aidlservice\jiuiv5\IWoyouService.java:441:
> error: reached end of file while parsing case TRANSACTION_getForce
> ^ C:\Users\User\Documents\Me\codes\AwesomeProject100\node_modules\rn-sunmi-inner-printer\android\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\woyou\aidlservice\jiuiv5\IWoyouService.java:442:
> error: reached end of file while parsing 2 errors
>
> FAILURE: Build failed with an exception.
>
> * What went wrong: Execution failed for task ':rn-sunmi-inner-printer:compileDebugJavaWithJavac'.
> > Compilation failed; see the compiler error output for details.
>
> * 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 1m 0s

React Native: error getting Invalid filename. Unable to add

I am very new to react-native and getting error while generating build for android.
npm version - 5.6.0
react-native - 2.0.1
node - v8.11.3
cd android && ./gradlew assembleRelease && cd ..
> :app:generateReleaseBuildConfig UP-TO-DATE :app:mergeReleaseShaders
> UP-TO-DATE :app:compileReleaseShaders UP-TO-DATE
> :app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets
> UP-TO-DATE :app:generateReleaseResValues :app:generateReleaseResources
> :app:mergeReleaseResources :app:recordFilesBeforeBundleCommandRelease
> :app:bundleReleaseJsAndAssets UP-TO-DATE
> :app:generateBundledResourcesHashRelease
> a80585d59325c208e3d120fe613639e73132576ef0e4e85a5de149e5d64c9e16
> :app:processReleaseManifest UP-TO-DATE :app:processReleaseResources
> /Users/ravindrayadav/Documents/ZupplerMobile/mayaflavorsofindia/android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_zupplernative_node_modules_reactnativegoogleplacesautocomplete_images_powered_by_google_on_white.png:
> error: Invalid filename. Unable to add.
>
> :app:processReleaseResources FAILED
>
> FAILURE: Build failed with an exception.
>
> * What went wrong: Execution failed for task ':app:processReleaseResources'.
> > com.android.ide.common.process.ProcessException: Failed to execute aapt
>
> * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
>
> BUILD FAILED
>
> Total time: 11.171 secs
delete image files in android/app/src/main/res/drawable-* directory and rebuild it