react-native-zendesk-chat icon indicating copy to clipboard operation
react-native-zendesk-chat copied to clipboard

Android does not build with RN 0.71.4

Open mmckinley8 opened this issue 1 year ago • 5 comments

Fails with the following error:

> Could not resolve com.zendesk:chat:3.1.0.
     Required by:
         project :app
         project :app > project :react-native-zendesk-chat
      > Could not resolve com.zendesk:chat:3.1.0.
         > Could not get resource 'https://zendesk.jfrog.io/zendesk/repo/com/zendesk/chat/3.1.0/chat-3.1.0.pom'.
            > Could not GET 'https://zendesk.jfrog.io/zendesk/repo/com/zendesk/chat/3.1.0/chat-3.1.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.zendesk:messaging:5.1.0.
     Required by:
         project :app
         project :app > project :react-native-zendesk-chat
      > Could not resolve com.zendesk:messaging:5.1.0.
         > Could not get resource 'https://zendesk.jfrog.io/zendesk/repo/com/zendesk/messaging/5.1.0/messaging-5.1.0.pom'.
            > Could not GET 'https://zendesk.jfrog.io/zendesk/repo/com/zendesk/messaging/5.1.0/messaging-5.1.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5.1/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I have added the dependencies to the build.gradle like the docs suggest:

api group: 'com.zendesk', name: 'chat', version: '2.2.0'
api group: 'com.zendesk', name: 'messaging', version: '4.3.1'

I also tried:

api group: 'com.zendesk', name: 'chat', version: safeExtGet('zendeskChatVersion', '3.1.0')
api group: 'com.zendesk', name: 'messaging', version: safeExtGet('zendeskMessagingVersion', '5.1.0')

And added maven url: maven { url 'https://zendesk.jfrog.io/zendesk/repo' }

mmckinley8 avatar Sep 13 '23 19:09 mmckinley8

I had to update like this to have this working. Hope it helps: patch

hdwilber avatar Sep 18 '23 18:09 hdwilber

Did you manage to fix it? I tried the above patch and it is not working for me

ahmed-abdelkader-00 avatar Oct 09 '23 19:10 ahmed-abdelkader-00

@ahmed-abdelkader-00 , TBH I am not sure how to fix the issue. You can try by adding this in android/build.gradle file of your project

allprojects {
    repositories {
        maven {
            url 'https://zendesk.jfrog.io/zendesk/repo'
        }
    }
}

hdwilber avatar Oct 27 '23 04:10 hdwilber

Actually it was adding this along with cleaning project that helped me to get it to work Thanks by the way

ahmed-abdelkader-00 avatar Oct 31 '23 14:10 ahmed-abdelkader-00

Now with the new react native version, there is no allProjects object anymore, and adding maven { url 'https://zendesk.jfrog.io/zendesk/repo' }

into projects object does not work. Do this, add complete allProjects object like below:

`buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 24 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" kotlinVersion = "1.8.0" } repositories { google() mavenCentral() // Don't add it here } dependencies { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") classpath 'com.google.gms:google-services:4.4.0' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9' } // Add it here, after the other dependencies allprojects { repositories { maven { url 'https://zendesk.jfrog.io/zendesk/repo' } } } }

apply plugin: "com.facebook.react.rootproject" `

this worked for me

adembacajdev avatar Mar 24 '24 21:03 adembacajdev