Skip to content

Commit 31053c8

Browse files
authored
fix for r8 problem (#995)
1 parent f6ef915 commit 31053c8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
maven {
5+
url = uri("https://storage.googleapis.com/r8-releases/raw")
6+
}
7+
}
8+
dependencies {
9+
classpath("com.android.tools:r8:8.1.44")
10+
}
11+
}

docs/getting-started/installation/reactnative.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,33 @@ import reactNativeXmlContent from "@site/code_blocks/getting-started/installatio
100100
Don't forget to enable the In-App Purchase capability for your project under `Project Target -> Capabilities -> In-App Purchase`
101101
:::
102102

103+
## Android Build Issues
104+
105+
### R8 Dependencies Conflict
106+
107+
If you encounter build failures related to R8 (Android's code shrinker) when using `react-native-purchases-ui`, you may see errors like:
108+
109+
```
110+
Execution failed for task ':app:mergeExtDexDevDebug'.
111+
> Could not resolve all files for configuration ':app:devDebugRuntimeClasspath'.
112+
```
113+
114+
This issue occurs due to a bug in earlier versions of Android Gradle Plugin (AGP) that affects R8 dependency resolution. To fix this, add the following to your project-level `build.gradle` file (not `app/build.gradle`):
115+
116+
import androidBuildFixContent from "@site/code_blocks/getting-started/installation/reactnative_android_build_fix.gradle?raw";
117+
118+
<RCCodeBlock
119+
tabs={[
120+
{
121+
type: "gradle",
122+
content: androidBuildFixContent,
123+
name: "build.gradle (project level)",
124+
},
125+
]}
126+
/>
127+
128+
This solution forces the use of a specific R8 version that resolves the dependency conflicts. For more details, see the [Google Issue Tracker](https://issuetracker.google.com/issues/342522142#comment8).
129+
103130
## Next Steps
104131

105132
- Now that you've installed the Purchases SDK in your React Native app, get started by [initializing an instance of Purchases →](/getting-started/quickstart#4-using-revenuecats-purchases-sdk)

0 commit comments

Comments
 (0)