Open rafakwolf opened 1 year ago
Hey! Having a look...
Same issue with a bare react-native project (no expo) using RN 0.72.3
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find io.adapty.internal:crossplatform:2.4.2.
Required by:
project :app > project :react-native-adapty
There was a suggestion in similar issue to manually include the maven repo via the following. Note path was adjusted for monorepo.
maven {
url "$rootDir/../../../node_modules/react-native-adapty/lib/android/localMaven"
}
This made no difference.
Was able to get a build working by setting the local repository under allProjects
rather than buildScript
.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
maven {
url "$rootDir/../../../../node_modules/react-native-adapty/lib/android/localMaven" // <---- This didn't work
}
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
}
allprojects {
project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/@react-native/codegen/")
}
}
}
}
allprojects {
repositories {
maven {
url "$rootDir/../../../node_modules/react-native-adapty/lib/android/localMaven" // <----- This worked
}
}
project.pluginManager.withPlugin("com.facebook.react") {
react {
reactNativeDir = rootProject.file("../../../node_modules/react-native/")
codegenDir = rootProject.file("../../../node_modules/@react-native/codegen/")
}
}
}
@divanc Hello, anything new about this? Thank you!
I was able to solve it via app.json. Add under plugins expo-build-properties
:
[
"expo-build-properties",
{
"android": {
"extraMavenRepos": [
"../../node_modules/react-native-adapty/lib/android/localMaven"
]
},
}
],
If you are in a monorepo, then use "$rootDir/../../../node_modules/react-native-adapty/lib/android/localMaven"
instead of the other path. :)
I was able to solve it via app.json. Add under plugins
expo-build-properties
:[ "expo-build-properties", { "android": { "extraMavenRepos": [ "../../node_modules/react-native-adapty/lib/android/localMaven" ] }, } ],
If you are in a monorepo, then use
"$rootDir/../../../node_modules/react-native-adapty/lib/android/localMaven"
instead of the other path. :)
I encountered the same problem with expo run: android --device
, building using eas was fine. Thanks @megacherry for this workaround, it works for me.
I encountered another problem after this. Expo somehow screws up the namespace in the build.gradle file, so the local development build will fail. The problem exists in both SDK48 and SDK49. The solution is to correct the namespace manually. I mention this here because I figure many are upgrading their Expo SDK because Google is enforcing targeted API Level 33 in a few days.
Thank you @megacherry and @jasonpeinko
Ouch, sorry guys, missed that... I'll read whether we can avoid extra step.
Strange that Expo is able to find one lib and fails to find another
I was able to solve it via app.json. Add under plugins
expo-build-properties
:[ "expo-build-properties", { "android": { "extraMavenRepos": [ "../../node_modules/react-native-adapty/lib/android/localMaven" ] }, } ],
If you are in a monorepo, then use
"$rootDir/../../../node_modules/react-native-adapty/lib/android/localMaven"
instead of the other path. :)
This solved my issue.
Hi folks, I'm migrating from expo 48 to 49 ... and the gradle version is being migrated to version 8. And react-native-adapty is throwing an error:
Can I have some help?
Thank you!
Originally posted by @rafakwolf in https://github.com/adaptyteam/AdaptySDK-React-Native/discussions/79