Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9b0e938

Browse files
chore(update-plugins): Mon Aug 14 08:05:15 UTC 2023
1 parent c151545 commit 9b0e938

File tree

1 file changed

+86
-1
lines changed

1 file changed

+86
-1
lines changed

‎plugins/rive.md

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ For Android, add this provider to your `AndroidManifest.xml` inside the `applica
7474
</provider>
7575
```
7676

77+
#### Gradle settings
78+
79+
Add this to your `app.gradle` inside the `android` section:
80+
81+
```yml
82+
kotlinOptions {
83+
jvmTarget = '1.8'
84+
}
85+
```
86+
87+
Ensure your gradle settings are setup to use Kotlin by adding a `gradle.properties` file (right next to your `app.gradle`) with the following:
88+
89+
```yml
90+
useKotlin=true
91+
```
92+
93+
## RiveView
94+
7795
Use `RiveView`:
7896

7997
```xml
@@ -89,7 +107,7 @@ Use `RiveView`:
89107
</Page>
90108
```
91109

92-
When using flavors, you can just register the element for usage in your markup:
110+
When using flavors, you can register the element for usage in your markup:
93111

94112
```ts
95113
import { RiveView } from '@nativescript/rive'
@@ -156,6 +174,73 @@ function loadedRive(args) {
156174
}
157175
```
158176

177+
## Troubleshooting
178+
179+
When configuring your Android app for Rive you may run into the following issues. Here's some solutions.
180+
181+
### Potential Error 1
182+
183+
```
184+
Execution failed for task ':app:checkDebugDuplicateClasses'.
185+
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules jetified-kotlin-stdlib-1.8.21 (org.jetbrains.kotlin:kotlin-stdlib:1.8.21) and jetified-kotlin-stdlib-jdk8-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21)
186+
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules jetified-kotlin-stdlib-1.8.21 (org.jetbrains.kotlin:kotlin-stdlib:1.8.21) and jetified-kotlin-stdlib-jdk7-1.6.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21)
187+
```
188+
189+
**Solution**
190+
191+
Add the following dependency constraints to the top of your `app.gradle` above the android section:
192+
193+
```
194+
dependencies {
195+
constraints {
196+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21"
197+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21"
198+
}
199+
}
200+
```
201+
202+
### Potential Error 2
203+
204+
```bash
205+
Execution failed for task ':app:mergeDebugNativeLibs'.
206+
2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
207+
- /Users/you/.gradle/caches/transforms-3/fed290951dd20dba6bd42d7106bb3f26/transformed/jetified-rive-android-8.1.3/jni/arm64-v8a/libc++_shared.so
208+
```
209+
210+
**Solution**
211+
212+
Add this section to `app.gradle` android section:
213+
214+
```bash
215+
android {
216+
...
217+
packagingOptions {
218+
pickFirst "lib/x86/libc++_shared.so"
219+
pickFirst "lib/x86_64/libc++_shared.so"
220+
pickFirst "lib/armeabi-v7a/libc++_shared.so"
221+
pickFirst "lib/arm64-v8a/libc++_shared.so"
222+
}
223+
...
224+
}
225+
```
226+
227+
### Potential Error 3
228+
229+
```bash
230+
This version (1.2.0-alpha05) of the Compose Compiler requires Kotlin version 1.6.10 but you appear to be using Kotlin version 1.7.10 which is not known to be compatible. Please fix your configuration (or `suppressKotlinVersionCompatibilityCheck` but don't say I didn't warn you!).
231+
```
232+
233+
**Solution**
234+
235+
Add a `before-plugins.gradle` file next to your app.gradle containing the following:
236+
237+
```
238+
ext {
239+
gradlePluginVersion = "7.3.1"
240+
kotlinVersion = "1.6.10"
241+
}
242+
```
243+
159244
## License
160245

161246
Apache License Version 2.0

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /