Error building JavaFXPorts project with Gradle 6.6.1 - javafx

Error Log:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'Mobile'.
> Could not create task ':debug'.
> Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'debug', but there is no existing task with that name.
* 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.
Anyway, heard something about it not supporting newer Gradle versions - if that is the case, to which older version Gradle should I downgrade?
My build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.17'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'application'
mainClassName = 'Mobile.Main'
dependencies {
testImplementation 'junit:junit:4.13'
}

Related

react-native and firebase native: Could not find method plugins

I am trying to configure a project that uses react-native and google firebase native.
The set up for react-native worked fine, but I ran into a problem with google firebase native.
I followed the instructions at rnfirebase.io.
When I try to sync My project with gradle files from Android Studio, I get the following error:
Build file 'C:\github\flashcards\flashcards\android\app\build.gradle' line: 139
A problem occurred evaluating project ':app'.
> Could not find method plugins() for arguments [build_2psolmxgn6smlx7165ef739cv$_run_closure1$_closure5#1b639892] on extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
...
Here is the relevant portion of my /android/build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
...
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath('com.google.gms:google-services:4.3.14')
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
I added the following two lines to the top of my /android/app/build.gradle file:
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
Any suggesions for how to fix this problem?
I expected the Sync Project with Gradle files command to complete successfully, but I receive the error described above.

firebase_core throw this error when i start building the project

when i try to run the app it shows me this error
Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':firebase_core:compileDebugAidl'.
Could not resolve all task dependencies for configuration ':firebase_core:debugCompileClasspath'.
Could not find com.google.firebase:firebase-common:.
Required by:
project :firebase_core
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.
Get more help at https://help.gradle.org
BUILD FAILED in 7s Exception: Gradle task assembleDebug failed with
exit code 1
i m using latest version of firebase_core
i have added firebse to my project
the build.gradle
rootProject.ext {
set('FlutterFire', [
FirebaseSDKVersion: '25.12.0'
])
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.2.1')
implementation "com.google.firebase:firebase-analytics"
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
.....
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
}
}
i resolved this problem by deleting
the
root.text of the firebase version it is in the
/build.gradle
and i built the project again.

Couldn't sync after adding depenency to gradle in VScode

I tried to configure my flutter project in order to use firebase. I added all the dependency and couldn't sync after adding the lines mentioned in the firebase to Gradle build.
How do I sync in vscode.
added depenency for firebase:
In project -> android -> app -> build.gradle :
apply plugin: 'com.google.gms.google-services'
In project -> gradle -> build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
**classpath 'com.google.gms:google-services:4.3.3'**
}
IN project -> pubspec.yaml
firebase_auth: ^0.14.0+5
Also ran flutter pub get
Error log:
* Error running Gradle:
ProcessException: Process "C:\Users\LENOVO\Documents\flutter_apps\time_tracker_flutter_course\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\LENOVO\Documents\flutter_apps\time_tracker_flutter_course\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 23s
Command: C:\Users\LENOVO\Documents\flutter_apps\time_tracker_flutter_course\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
When using Firebase, you need to download the google-services.json file and add it to your project:
Where do I place Googleservices.json in Flutter app in order to solve 'google-services.json is missing'
Then in the android/build.gradle, you need to add the google() maven repository:
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
...
// Add this line
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
...
}
}
and inside android\app\build.gradle, you need to add the google-service plugin:
apply plugin: 'com.google.gms.google-services'
Check this:
https://firebase.google.com/docs/flutter/setup?platform=android

Trying to find a working solution to setup Flutter with Firebase on Android. keep getting errors

I am trying to find the steps to get flutter working with Firebase with a clean Install of a flutter project and Firebase setup. Here is the bare minimum setup of files per their instructions.
my pubspec.yaml
dev_dependencies:
flutter_test:
sdk: flutter
firebase_core: ^0.4.0+1
firebase_auth: ^0.11.1+3
cloud_firestore: ^0.12.9
my build.gradle file
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.3.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my /buildgradle file, I just added to this to end (per firestore instructions)
apply plugin: 'com.google.gms.google-services'
I also put the google.services.json file into my android/app folder.
I then try to build and get this error:
FAILURE:
Build failed with an exception.
* Where:
Build file 'C:\Users\Mike\Documents\VSCode Projects\flutterplayground\graceblox\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Command: C:\Users\Mike\Documents\VSCode Projects\flutterplayground\graceblox\android\gradlew.bat app:properties
Does anyone have the basic setup working ?? I have searched and found all kinds of responses to change the versions, add androidx, etc..but nothing seems to work. I'm hoping there is a defined set of oonfigurion steps someone has to get this working?

Build and run a jar inside of a Gradle task

I am using Java, Spring, and Gradle. I am new to gradle and am trying to understand some stuff. I currently have gradle successfully building a jar file.
I would like to add a task so that gradle runs the jar that it builds.
this way I could do
./gradlew clean build run
or I could just do it in one command if possible. The pseudocode of which would be
task run {
clean
build
java -jar myJar.jar
}
How would I go about doing this?
---INFO----
my current build.gradle file:
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:0.5.0.M6")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-rest-service'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web:0.5.0.M6")
compile("com.fasterxml.jackson.core:jackson-databind")
testCompile("junit:junit:4.11")
}
task wrapper(type: Wrapper) {
gradleVersion = '1.10'
}
It's important to think in task dependencies. run wouldn't execute some other tasks sequentially (tasks can't do that); rather, it would declare task dependencies on its prerequisites, such as perhaps jar. Anyway, the easiest solution is to just apply the application plugin, which you can learn more about in the Gradle User Guide.

Resources