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 Local build failure #83

Open
mercpls opened this issue Mar 27, 2023 · 2 comments
Open

React Native Local build failure #83

mercpls opened this issue Mar 27, 2023 · 2 comments

Comments

@mercpls
Copy link

mercpls commented Mar 27, 2023

[RUN_GRADLEW] Could not determine the dependencies of task ':app:processDebugResources'.
[RUN_GRADLEW] > Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
[RUN_GRADLEW] > Could not resolve com.fingerprint.android:pro:2.2.3.
[RUN_GRADLEW] Required by:
[RUN_GRADLEW] project :app > project :fingerprintjs_fingerprintjs-pro-react-native
[RUN_GRADLEW] > Could not resolve com.fingerprint.android:pro:2.2.3.
[RUN_GRADLEW] > Could not get resource 'https://www.jitpack.io/com/fingerprint/android/pro/2.2.3/pro-2.2.3.pom'.
[RUN_GRADLEW] > Could not HEAD 'https://www.jitpack.io/com/fingerprint/android/pro/2.2.3/pro-2.2.3.pom'. Received status code 401 from server: Unauthorized
[RUN_GRADLEW] > Could not resolve com.fingerprint.android:pro:2.2.3.
[RUN_GRADLEW] > Could not get resource 'https://www.jitpack.io/com/fingerprint/android/pro/2.2.3/pro-2.2.3.pom'.
[RUN_GRADLEW] > Could not HEAD 'https://www.jitpack.io/com/fingerprint/android/pro/2.2.3/pro-2.2.3.pom'. Received status code 401 from server: Unauthorized

Unable to resolve jitpack, any ideas? Same thing on either of the newest versions

@mercpls
Copy link
Author

mercpls commented Mar 27, 2023

Hey all, this was due to not having a gradle config that worked with expo, here's a config plugin for any Expo users that solves this issue.

const { withProjectBuildGradle } = require('@expo/config-plugins');

function addFingerprintRepository(config) {
  return withProjectBuildGradle(config, (config) => {
    const fingerprintRepo = 'maven {\n  url("https://maven.fpregistry.io/releases")\n}\n';
    const jitpackRepo = 'maven {\n  url("https://www.jitpack.io")\n}\n';
    const regex = /repositories\s?{([\s\S]*?)}/gm;
    const replacement = `repositories {\n  ${fingerprintRepo}  ${jitpackRepo}$1}`;
    config.modResults.contents = config.modResults.contents.replace(regex, replacement);
    return config;
  });
}

module.exports = addFingerprintRepository;

@makma
Copy link
Member

makma commented Mar 28, 2023

Hello @mercpls, thank you for sharing this with us. We'll explore if it makes sense to add it to the SDK or at least document it in the official docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants