superwall / react-native-superwall

Remotely configure every aspect of your paywall and double your revenue.
MIT License
12 stars 0 forks source link

React Native Android Maven Repo Errors 404 #3

Closed quinn56 closed 5 months ago

quinn56 commented 5 months ago

When I try to build my app for android react-native, it can't find the android superwall dependency at https://mvn.superwall.com/release which gives a 404.

yusuftor commented 5 months ago

Please make sure you've added our repo to your app's build.gradle or as a plugin in an expo project: https://superwall.com/docs/installation-via-package#android-configuration

brian-wagerlab commented 5 months ago

@yusuftor I have added the repo to my apps build.gradle. I believe the issue is that the repo isn't properly serving the package. The URL returns a 404 when I try to hit it for the package, am I missing something here?

Screenshot 2024-04-12 at 8 33 38 PM
yusuftor commented 5 months ago

Accessing it via the browser won't work, but it definitely is working in react native projects. Can you paste your react native android app's build.gradle here?

brian-wagerlab commented 5 months ago
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 26
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "25.1.8937393"
        kotlinVersion = "1.8.0"
    }
    repositories {
        // For @react-native-firebase/crashlytics (and react-native)
        google()
        // For @react-native-fbsdk-next (and react-native)
        mavenCentral()
        // For superwall sdk
        maven { url 'https://mvn.superwall.com/release' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle"
        classpath 'com.facebook.react:react-native-gradle-plugin'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin"

        // For @react-native-google-signin/google-signin
        // For @react-native-firebase/app
        classpath 'com.google.gms:google-services:4.4.1'

        // For @react-native-firebase/crashlytics
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'

        // For @react-native-firebase/perf
        classpath 'com.google.firebase:perf-plugin:1.4.2'
    }
}

apply plugin: "com.facebook.react.rootproject"
yusuftor commented 5 months ago

Ah it's in the wrong place, it needs to be added to allprojects rather than buildscript:


buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 26
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "25.1.8937393"
        kotlinVersion = "1.8.0"
    }
    repositories {
        // For @react-native-firebase/crashlytics (and react-native)
        google()
        // For @react-native-fbsdk-next (and react-native)
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle"
        classpath 'com.facebook.react:react-native-gradle-plugin'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin"

        // For @react-native-google-signin/google-signin
        // For @react-native-firebase/app
        classpath 'com.google.gms:google-services:4.4.1'

        // For @react-native-firebase/crashlytics
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'

        // For @react-native-firebase/perf
        classpath 'com.google.firebase:perf-plugin:1.4.2'
    }
}

// Needs to be here:
allprojects {
  repositories {
    maven { url 'https://mvn.superwall.com/release' }
  }
}

apply plugin: "com.facebook.react.rootproject"
brian-wagerlab commented 5 months ago

@yusuftor that did the trick thanks for all the help