this is another error am getting
FAILURE: Build failed with an exception.
What went wrong:
ANDROID_HOME not specified. Either set it as a gradle property, a system environment variable or directly in your build.gradle by setting the extension jfxmobile.android.androidSdk.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
i think, you have to add your android path on your build.gradle . Here is my setting for the android part:
jfxmobile {
android {
// signingConfig {
// storeFile file("")
// storePassword ''
// keyAlias ''
// keyPassword ''
// }
applicationPackage = 'my.package.app.name'
manifest = 'src/android/AndroidManifest.xml'
resDirectory = 'src/android/res'
androidSdk ="$System.env.HOME/android-sdks" // this is bassicly path to your android sdk
}
}
Try it.
Regards,
Ivan
Since you haven't defined the OS you are using, I'll go ahead and include both.
Ubuntu (or any other Linux distro I think):
Add the following to your ~/.bashrc file.
First
nano ~/.bashrc
Then add the following in the last line
export ANDROID_HOME= "Enter you sdk path"
This path will end with a /Android/sdk/
For eg. mine is /home/Android/sdk/
Log out and log in again and presto, magic!
If bashrc does not seem to work. Use profile instead ie ~/.profile
Remember to log out to allow changes to occur on startup.
Windows:
We can't define names to exported paths in Windows(as far as I know) so we need to include it in the build.gradle
jfxmobile {
android {
compileSdkVersion = '15'
buildToolsVersion = '22.0.1'
androidSdk = 'C:/Users/your username/AppData/Local/Android/sdk'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
}
}
And hey, there's the magic again!
If you installed Android somewhere else, point it to the correct direction.
Use the gluon plugin for Netbeans. Its the best way I found for working with javafxports. It takes all headaches from customizing basic things out of the way.
Why set it globally in Ubuntu and not in the build.gradle file?
Declaring it globally is an approach which means you don't have to repeat the same process again in a new project.
Related
I'm cloning an android course project from GitHub, and facing a series of errors, I've manged to solve some of them till I stuck in last one, the scenario as follows:
1- error: Could not find com.android.support:appcompat-v7:25.1.0. (Solved).
2- error: File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.(solved)
3-error: Cannot specify -processorpath or --processor-path via CompileOptions.compilerArgs. Use the CompileOptions.annotationProcessorPath property instead.
This one that I can't fixError snip
and after adding this implementation (
implementation 'com.google.firebase:firebase-core:17.4.3'), I get that error as well.
error: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
Error snip
I've found that link that has exact fix to the errors mentioned in the question.
Cannot specify -processorpath or --processor-path via `CompileOptions.compilerArgs`
solution.
Delete “apply plugin: ‘android-apt’” line from your app module build.gradle file.
(Not necessary to work) Delete “classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.2’” from your top-level build.gradle file.
In “dependencies” section in build.gradle rename
apt ‘net.simonvt.schematic:schematic-compiler:0.6.3’
to
annotationProcessor ‘net.simonvt.schematic:schematic-compiler:0.6.3’
I’m using newest 26.0.2 buildToolsVersion as well as newest support libraries and everything works like a charm.
Remember to use newest gradle (4.1-all for now) and gradle plugin (3.0.0 for now). Add google repository to download newest support libraries. Sync and rebuild project. Now when you go to your manifest file, there should be no more red android:name=".provider.generated.SquawkProvider"
My top-level build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.0’
// Google Services plugin
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Let me know if it works.
I am currently working on a Gradle custon plugin that should analyse my root project for specific configs in every subproject and then generate some kotlin source code in the build dir. I can't figure out a way to invoke my annotation processor from my gradle plugin which has a custom task for this matter.
Any ideas how to achieve this? Any resource/tutorial/documentation is also highly welcomed.
Thanks in advance and be safe.
After a long time of googling and mostly trying and failing, I finally figured out the solution to my question. Here is my task configuration.
Basically we have to provide the annotation processor's classpath as a project configuration. In my case I added this block to the project's build.gradle
allprojects {
configurations {
myProcessor //pick any name!!!
}
}
and then as a dependency in app build.gradle
dependencies {
myProcessor "PATH_TO_MY_PROCESSOR_JAR" //or maven dependency if it's uploaded to maven central
}
tasks.register(
"myTaskName",
JavaCompile::class.java
) {
compiler ->
with(compiler.options) {
isFork = true
isIncremental = true
}
with(compiler) {
group = shuttle.plugin.ShuttlePlugin.TASK_GROUP
destinationDir = outputDir
classpath = variant.getCompileClasspath(null)
options.annotationProcessorPath = configurations.getByName("myProcessor") //this is the missing piece!!
source = files(projectDir.resolve("src/main/java")).asFileTree
}
}
However, this task will only compile Java classes Only and not kotlin.
Any Idea how to fix this behaviour knowing that my plugin targets only android apps so I don't have direct access to kotlinCompile gradle default task?
A have the following error and searched a lot to solve it, but can't get hold of what versions to use and what to do.
The library com.google.firebase:firebase-iid is being requested by various other libraries at [[16.2.0,16.2.0]], but resolves to 15.1.0.
remove
implementation 'com.google.firebase:firebase-messaging:17.0.0'
from your app gradle
and if someone is facing error like
'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.0.1) classpath
then
under your project level gradle file
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
add above lines to bottom of Project level gradle file
I have a working symfony project. I have it on a private bitbucked repository and locally the website works without an issue.
Today I tried to deploy the project onto an external server linuxpl.com.
Steps taken include:
Istalling composer
Adding the mysql database
Running git clone to get the data into a proper location
Running composer install on the folder to install everything and connect to the db
Cleared the cache
Set the project root as ....domain/project_name/web
However after completing all these steps, when running the website with regular server:run I'm getting this odd error:
Parse error: syntax error, unexpected '.' in /home/spirifer/domains/surowcewobiektywie.pl/konkurs/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1571
Not sure if this is of any importance but the mentioned code partion looks like this in my local files:
// Some objects throw exceptions when they have __call, and the method we try
// to call is not supported. If ignoreStrictCheck is true, we should return null.
try {
$ret = $object->$method(...$arguments);
} catch (BadMethodCallException $e) {
if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
return;
}
throw $e;
}
The local version does not differ from the one on the server.
My local machine has PHP 7.0.9 and the remove server has PHP 7.0.14
How could I fix this issue?
PHP 5.6 adds Variadic functions, with "...". However, Twig v1.x only required the use of PHP 5.2.7 or above.
If you didn't explicitly update to Twig 2.0, it's very possible you have used the 'death star' version constraint in the composer file - '*'. which allows uncontrolled version updates to the latest version. If this is the case, you will need to either update your version of PHP, or at least require just a previous version of Twig/twig, "^1.32" would be the latest in the version 1 series of Twig.
First off, I tried to search for questions that kind of relates to the problem that I am facing, but alas no luck at all! If this question has been answered before, please do point me to it and sorry for the inconvenience.
Coming as a Cordova developer react-native sounds like a dream coming true but I am still a noob at it and am still learning it. I installed this SQLite plugin and followed every step for android development. But when I try to run the app on a simulator I always get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-sqlite-storage'.
> failed to find Build Tools revision 23.0.1
The configurations that I did:
settings.gradle:
rootProject.name = 'todo'
include ':app'
include ':react-native-sqlite-storage'
project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/src/android')
build.gradle:
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
[...]
MainApplication.java:
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new SQLitePluginPackage(this),
new MainReactPackage();
);
Thank you in advance.
there is another "build.gradle" file that you should config!
in your ".../node_modules/react-native-sqlite-storage/src/android/src/build.gradle"
change the build version on that file too!
set it with your build.gradle that already changed!
In your Android studio go to your SDK manager and find SDK tools tab. In there if you check the 'Show Package Details' you will find "Android SDK Build-Tools 23.0.1"
Install that and you are good to go :)