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

Unable to build Android debug build #8

Closed
GaddiSunshine opened this issue Feb 28, 2024 · 11 comments
Closed

Unable to build Android debug build #8

GaddiSunshine opened this issue Feb 28, 2024 · 11 comments

Comments

@GaddiSunshine
Copy link

GaddiSunshine commented Feb 28, 2024

Unable to build an android debug build with the package "@adapty/react-native-ui": "2.0.1". Building a release build works.
When I remove the @adapty/react-native-ui package, then the build works.

Platform:

  • Android

Versions:

"react-native": "0.72.6",
"expo": "49.0.18",
"react-native-adapty": "2.7.0",
"@adapty/react-native-ui": "2.0.1",
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find io.adapty.internal:crossplatform-ui:2.0.1.
     Searched in the following locations:
       - file:/Users/user/Documents/Smitten/app/client/node_modules/react-native-adapty/lib/android/localMaven/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - file:/Users/user/Documents/Smitten/app/client/node_modules/react-native/android/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - file:/Users/user/Documents/Smitten/app/client/node_modules/jsc-android/dist/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - https://dl.google.com/dl/android/maven2/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - https://repo.maven.apache.org/maven2/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - https://www.jitpack.io/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
       - https://oss.sonatype.org/content/repositories/snapshots/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom
     Required by:
         project :app > project :adapty_react-native-ui
@vladd-g
Copy link
Contributor

vladd-g commented Feb 28, 2024

@GaddiSunshine now you can upgrade, we've just released "react-native-adapty": "2.9.3" and "@adapty/react-native-ui": "2.1.0"

The first path from the snippet provided is file:/Users/user/Documents/Smitten/app/client/node_modules/react-native-adapty/lib/android/localMaven/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom, did you add it manually as maven { ........ }?
If so, you can also add the missing one, where the react-native-adapty/lib/ is replaced by @adapty/react-native-ui/

@GaddiSunshine
Copy link
Author

@GaddiSunshine now you can upgrade, we've just released "react-native-adapty": "2.9.3" and "@adapty/react-native-ui": "2.1.0"

The first path from the snippet provided is file:/Users/user/Documents/Smitten/app/client/node_modules/react-native-adapty/lib/android/localMaven/io/adapty/internal/crossplatform-ui/2.0.1/crossplatform-ui-2.0.1.pom, did you add it manually as maven { ........ }? If so, you can also add the missing one, where the react-native-adapty/lib/ is replaced by @adapty/react-native-ui/

Thanks for the reply. I tried the new versions.

Versions:

"@adapty/react-native-ui": "2.1.0",
"expo": "49.0.18",
"react-native": "0.72.6",
"react-native-adapty": "2.9.3",

With these versions I still have the same problem:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find io.adapty.internal:crossplatform-ui:2.1.1.
     Searched in the following locations:
       - file:/Users/gudmundurgardararnason/Documents/Smitten/app/client/node_modules/react-native-adapty/lib/android/localMaven/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - file:/Users/gudmundurgardararnason/Documents/Smitten/app/client/node_modules/react-native/android/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
       - file:/Users/gudmundurgardararnason/Documents/Smitten/app/client/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://repo.maven.apache.org/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
       - https://oss.sonatype.org/content/repositories/snapshots/io/adapty/internal/crossplatform-ui/2.1.1/crossplatform-ui-2.1.1.pom
     Required by:
         project :app > project :adapty_react-native-ui

I have not added anything manually as the android folder is generated by expo in a managed workflow.

@vladd-g
Copy link
Contributor

vladd-g commented Feb 28, 2024

@GaddiSunshine could you please try the Sync project with gradle files option with the Android project?

@GaddiSunshine
Copy link
Author

@GaddiSunshine could you please try the Sync project with gradle files option with the Android project?

Hey @vladd-g I have tried cleaning, syncing, prebuilding, building and everything. When I have the @adapty/react-native-ui installed, I always get the same error when building an android debug build.

@GaddiSunshine
Copy link
Author

@GaddiSunshine could you please try the Sync project with gradle files option with the Android project?

Hey @vladd-g I have tried cleaning, syncing, prebuilding, building and everything. When I have the @adapty/react-native-ui installed, I always get the same error when building an android debug build.

I tried upgrading to the following packages:

"react-native": "0.73.4",
"expo": "50.0.7",

Still getting the same errors while trying to build android debug build.

@vladd-g
Copy link
Contributor

vladd-g commented Feb 29, 2024

@GaddiSunshine did you try prebuilding?

But please be careful,

If you manually modify the android or ios directory, you cannot re-run npx expo prebuild safely, as this may overwrite your changes.

As far as I can see, the expo is aware of custom maven path from the main Adapty SDK (the first path in the list in your snippet), but isn't aware of that from the AdaptyUI SDK. Looks like it needs rebuilding or something

@GaddiSunshine
Copy link
Author

@GaddiSunshine did you try prebuilding?

But please be careful,

If you manually modify the android or ios directory, you cannot re-run npx expo prebuild safely, as this may overwrite your changes.

As far as I can see, the expo is aware of custom maven path from the main Adapty SDK (the first path in the list in your snippet), but isn't aware of that from the AdaptyUI SDK. Looks like it needs rebuilding or something

Yes, I have tried prebuilding. I have removed and prebuilt/built the android folder again multiple times. I have done gradle clean and gradle sync. Nothing is working. Every time @adapty/react-native-ui is in my dependencies, I am unable to build. Always get the same error on android.

@vladd-g
Copy link
Contributor

vladd-g commented Feb 29, 2024

Well, as a temporary solution, you can add it manually to your android module's build.gradle (or settings.gradle, depending on your project settings, detailed info in the collapsed The instruction on how to add it section here, but instead of mavenCentral() you need maven { url 'RELATIVE_PATH_TO_NODE_MODULES/@adapty/react-native-ui/android/localMaven' })

@GaddiSunshine
Copy link
Author

Well, as a temporary solution, you can add it manually to your android module's build.gradle (or settings.gradle, depending on your project settings, detailed info in the collapsed The instruction on how to add it section here, but instead of mavenCentral() you need maven { url 'RELATIVE_PATH_TO_NODE_MODULES/@adapty/react-native-ui/android/localMaven' })

Hey @vladd-g Thanks for all the replies. It turned out to be a similar issue to this one. I was able to do this workaround. Now I am able to build and everything works as expected.

@vladd-g
Copy link
Contributor

vladd-g commented Mar 1, 2024

Hey @GaddiSunshine, happy to hear that! And thanks for sharing!

@vladd-g
Copy link
Contributor

vladd-g commented Mar 1, 2024

@GaddiSunshine also please update "react-native-adapty" to "2.9.6"

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