fingerprintjs / fingerprintjs-android

Swiss army knife for identifying and fingerprinting Android devices. MIT license, no restrictions on usage in production.
https://fingerprint.com/github/
MIT License
551 stars 77 forks source link

React Native Local build failure #83

Open mercpls opened 1 year ago

mercpls commented 1 year ago

[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 commented 1 year ago

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 commented 1 year ago

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.