You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-15Lines changed: 52 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,27 @@ Use this plugin if you want to:
35
35
-[Kradle](https://buijs.dev/kradle-1/) cli tool
36
36
- For a step-by-step guide (doing everything manually), see the battery app with Klutter [tutorial](https://buijs.dev/klutter-2/).
37
37
38
+
Using the IDE plugins or interactive kradle tool are the
39
+
preferred options to create projects, as opposed
40
+
to doing everything manually. You can install
41
+
the kradle tool from git or pub:
42
+
43
+
```shell
44
+
## Get from pub
45
+
dart pub global activate klutter
46
+
47
+
## Get from git
48
+
dart pub global activate --source git https://github.com/buijs-dev/klutter-dart.git
49
+
50
+
## Use it globally
51
+
dart pub global run klutter:kradle
52
+
```
53
+
54
+
A native kradle executable is added to the project workspace,
55
+
when creating a new project using an IDE plugin.
56
+
57
+
See the kradle [tutorial](https://buijs.dev/kradle-1/) for usage instructions.
58
+
38
59
# Installation
39
60
<b>What's the point?</b></br>
40
61
Plugins build with the Klutter Framework work slightly different from regular plugins.
@@ -45,7 +66,7 @@ Add the Klutter library to dependencies in the pubspec.yaml:
45
66
46
67
```yaml
47
68
dev_dependencies:
48
-
klutter: ^2.0.0
69
+
klutter: ^3.0.0
49
70
```
50
71
51
72
Then run:
@@ -70,7 +91,7 @@ Install Klutter as dependency as described [here](#Installation).
70
91
Initialize Klutter in your project by running:
71
92
72
93
```shell
73
-
flutter pub run klutter:consumer init
94
+
dart run klutter:kradle init
74
95
```
75
96
76
97
The init task will set up Klutter for both Android and iOS.
@@ -79,7 +100,7 @@ Klutter plugins can be added by running the add command.
79
100
<B>Example</B>:</br> Add the library 'awesome_plugin' to your project:
80
101
81
102
```shell
82
-
flutter pub run klutter:consumer add lib=awesome_plugin
103
+
dart run klutter:kradle add lib=awesome_plugin
83
104
```
84
105
85
106
<b>Background</b></br>
@@ -152,33 +173,27 @@ flutter create --org com.example --template=plugin --platforms=android,ios -a ko
152
173
Install the Klutter Framework as dependency and then run:
153
174
154
175
```shell
155
-
flutter pub run klutter:producer init
176
+
dart run kradle:init
156
177
```
157
178
158
179
Build the platform module by running the following in the root folder (takes a few minutes):
159
180
160
181
```shell
161
-
./gradlew clean build -p "platform"
162
-
```
163
-
164
-
It is also possible to import the kradle tool in your project using Gradle:
165
-
166
-
```shell
167
-
./gradlew klutterGetKradle
182
+
dart run klutter:kradle build
168
183
```
169
184
170
-
And then build the project with kradle:
185
+
Alternatively use gradle directly with the following command:
171
186
172
187
```shell
173
-
./kradlew build
188
+
./gradlew clean build -p "platform"
174
189
```
175
190
176
-
177
191
Now test the plugin by following the steps outlined [here](#Usage) in the root/example project.
178
192
When done you can run the example project from the root/example/lib folder and see your first plugin in action!
179
193
180
194
# Faq
181
195
1.[App won't start on...](#App%20won't%20start)
196
+
2.[Build fails](#build-fails)
182
197
183
198
## App won't start
184
199
Make sure you have followed all the following steps:
@@ -209,4 +224,26 @@ folder.
209
224
If there's an error message saying something similiar to '...example/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh: Permission denied'
210
225
then try one of:
211
226
- delete the Podfile.lock and run pod install in root/example/ios folder.
212
-
- run pod deintegrate and then pod install in root/example/ios folder.
227
+
- run pod deintegrate and then pod install in root/example/ios folder.
228
+
229
+
## Build fails
230
+
1.[Java toolchain error](#java-toolchain-error)
231
+
232
+
### Java toolchain error
233
+
When you get an error like below, indicating no compatible Java version is detected, make sure you
234
+
have the same Java version installed as required by the klutter project.
235
+
236
+
```shell
237
+
* What went wrong:
238
+
Could not determine the dependencies of task ':klutter:hello_world:compileDebugKotlinAndroid'.
239
+
> No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific}.
240
+
> No locally installed toolchains match ...
241
+
```
242
+
243
+
You might also have to add the following plugin to the settings.gradle(.kts) files:
244
+
245
+
```kotlin
246
+
plugins {
247
+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
0 commit comments