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

i am getting below error when i run this command : flutter pub run klutter:producer install=platform #14

Open
vishwaprojects opened this issue Apr 21, 2024 · 10 comments

Comments

@vishwaprojects
Copy link

i am following tutorial by klutter ( https://buijs.dev/klutter-2/)

KLUTTER: Received invalid command.

The following commands are valid:
flutter pub run klutter:consumer add lib=foo_example
flutter pub run klutter:consumer init
flutter pub run klutter:producer init
flutter pub run klutter:producer init bom= (default is 2023.3.1.beta)
flutter pub run klutter:producer init flutter= (default is 3.10.6)
flutter pub run klutter:producer init flutter= bom=
flutter pub run klutter:producer get flutter= (one of versions: {3.0.5, 3.3.10, 3.7.12, 3.10.6})

@buijs-dev
Copy link
Owner

Hm tutorial is a bit outdated. Did you follow the tutorial literally or did you use newer dependency versions?

Which command gave this error?

@vishwaprojects
Copy link
Author

i followed each and every step of the tutorial , every step successfully ran but struck at step 3 could you please update the tutorial or suggest me some blogs or tutorials would be a great help i am trying this since 2 days

thank you

@buijs-dev
Copy link
Owner

For now you can check the cookbook examples. I am refactoring the project and will update the tutorials when done, but because this is just a side project it takes a while...

@vishwaprojects
Copy link
Author

thank you @buijs-dev , if you need any help from my side, i am ready to help you , this project will become big for sure

@buijs-dev
Copy link
Owner

@vishwaprojects 2024.1.2 is released. Could you have a look at the cookbook examples and run them locally or try to create a new project using the Intellij/Android Studio plugin?

@vishwaprojects
Copy link
Author

definitely been waiting for your release @buijs-dev

@vishwaprojects
Copy link
Author

i cloned the hello_world i tried to run intiallly it prompted me to add the below thing in gradle
lintOptions { │
│ checkReleaseBuilds false │
│ }

so i added this in app level build gradle then i tried to run it i got the below error

You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\vishwateja\Desktop\flutter_vs\klutter-cookbook\hello_world\example\android\app\build.gradle' line: 32

  • What went wrong:
    Could not compile build file 'C:\Users\vishwateja\Desktop\flutter_vs\klutter-cookbook\hello_world\example\android\app\build.gradle'.

startup failed:
build file 'C:\Users\vishwateja\Desktop\flutter_vs\klutter-cookbook\hello_world\example\android\app\build.gradle': 32: Unexpected character: '?' @ line 32, column 161.
?
^

1 error

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 1s
Running Gradle task 'assembleDebug'... 2,665ms
Error: Gradle task assembleDebug failed with exit code 1

@buijs-dev
Copy link
Owner

You should not have to do any changes to do the examples to run it.

Can you try this:

  • Clone cookbook again
  • Follow the steps in the readme (to setup local.properties, kradle, etc).
  • Run "./gradlew build -p platform" in the hello_world directory.
  • Start the app.

@vishwaprojects
Copy link
Author

./gradlew klutterGetKradle

this command is giving the below error

  • What went wrong:
    A problem occurred evaluating root project 'hello_world'.

Failed to apply plugin 'com.android.internal.library'.
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Your current JDK is located in C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

solutions tried (from stack overflow )

changed my java home var into java 17
changed to java 17 in my build tools

no use same error

@Xerosigma
Copy link

Xerosigma commented Jun 8, 2024

C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot

@vishwaprojects If you're still seeing the same error it's likely it's still relying on JDK 11. Have you tried removing it?

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

3 participants