adaptyteam / AdaptySDK-React-Native

React Native SDK for growing in-app subscriptions
https://docs.adapty.io/docs/quickstart
MIT License
122 stars 12 forks source link

Can't build in dev mode: Could not find io.adapty.internal:crossplatform-ui:2.1.1. & Could not find io.adapty.internal:crossplatform:2.10.3. #119

Closed denis-rift closed 3 months ago

denis-rift commented 3 months ago

Description

Pakcages "react-native": "0.73.7", "react-native-adapty": "^2.10.1", "@adapty/react-native-ui": "^2.1.2",

Command: react-native run-android

Result:

> Could not find io.adapty.internal:crossplatform-ui:2.1.1.
     Searched in the following locations:
       - https://oss.sonatype.org/content/repositories/snapshots/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - https://repo.maven.apache.org/maven2/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - file: [LOCAL]/node_modules/jsc-android/dist/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - https://dl.google.com/dl/android/maven2/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - https://www.jitpack.io/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - file: [LOCAL]/node_modules/@bugsnag/react-native/android/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
     Required by:
         project :app > project :adapty_react-native-ui
   > Could not find io.adapty.internal:crossplatform:2.10.3.
     Searched in the following locations:
       - https://oss.sonatype.org/content/repositories/snapshots/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
       - https://repo.maven.apache.org/maven2/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
       - file:/[LOCAL]node_modules/jsc-android/dist/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
       - https://dl.google.com/dl/android/maven2/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
       - https://www.jitpack.io/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
       - file:[LOCAL]node_modules/@bugsnag/react-native/android/io/adapty/internal/crossplatform/2.10.3/crossplatform-2.10.3.pom
     Required by:
         project :app > project :react-native-adapty

Version

2.10.1

What platforms are you seeing the problem on?

Android

System info

info Fetching system and libraries information...
System:
  OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
  Memory: 4.01 GB / 15.30 GB
  Shell:
    version: 5.1.16
    path: /bin/bash
Binaries:
  Node:
    version: 18.18.2
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: ~[LOCAL]/node_modules/.bin/yarn
  npm:
    version: 9.8.1
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.03.06.00
    path: /home/linuxbrew/.linuxbrew/bin/watchman
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.0.5
    path: [LOCAL].rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: ^18.2.0
  react-native:
    installed: 0.73.7
    wanted: 0.73.7
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

info React Native v0.74.1 is now available (your project is running on v0.73.7).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=linux".
vladd-g commented 3 months ago

Hey @denis-rift

Could you please try this solution?

denis-rift commented 3 months ago

Ok thanks @vladd-g

The trick was to use allprojects instead of buildscript, as this:

allprojects {
    repositories {
        maven { url '../../node_modules/@adapty/react-native-ui/android/localMaven' }
        maven { url '../../node_modules/react-native-adapty/lib/android/localMaven' }
    }
}