Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0 in android studio - firebase

I am trying to run my emulator after adding the firebase and google sign in plug ins/dependencies to my gradle.build files and now I am receiving the error
"Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0"
anyone know if I am doing something wrong this is a react native firebase app.
I am not sure what to try. This is my first app I am doing for a project at school and I do not really know what I am doing. I have just been following tutorials online

Solve this issue by deleting the .gradle folder from <NameOfProject>/android and again run npm run android

I think I just had this same problem. I don't have any idea what your error logs are though so I am not certain however this is my error log right here:
`> Task :react-native-gradle-plugin:compileKotlin FAILED
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11) jvm targeta version. 1 actionable task: 1 executed`
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-gradle-plugin:compileKotlin'. Failed to query the value of task ':react-native-gradle-plugin:compileKotlin' property 'compilerRun Kotlin could not find the required JDK tools in the Java installation. Make sure Kotlin compilat
This error however I fixed by editing the gradle-wrapper.properties file's distributionUrl variable. I changed the distributionUrls gradle version to 7.4.2 the file is in Project-Name\android\gradle\wrapper\gradle-wrapper.properties
My error log is saying that gradle's version of JVM want's to be version 11 and is not but you can check gradle's jvm version by using cd android in the project root directory and after that run ./gradlew --version Change JVM's version from the version it is showing to the version that it says is required like in my case v 11. The way I changed gradle's JVM version required chocolatey which is a package manager. This is where you can require it https://chocolatey.org/install and after you have setup chocolatey open a new terminal that has administrative privileges and run this choco install -y nodejs-lts openjdk11 with the JVM version it is asking for inside your error logs
and finally run npm start and after that npm run android inside a refreshed and new terminal and gradle's JVM version and gradle's version will be updated to the specified versions

We could better help if you could you show us your android/build.gradle and android/app/build.gradle files, but here are more specific instructions than you find in the docs:
In android/build.gradle, dependencies should look something like this:
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath("com.android.tools.build:gradle:<version>")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:<version>")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/build.gradle
It is known this works with the classpaths at the beginning.
--
Also in android/app/build.gradle, it is known that the google-services dep works at the end of the file.
apply plugin: 'com.google.gms.google-services'
and make this the last "implementation" under dependencies (around line 272)
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' // <-- add this; newer versions should work too
see: https://github.com/gyani-sunkara/rn-firebase-login-starter/blob/main/android/app/build.gradle
Then, delete android/.gradle and run npx react-native run-android in the root directory.

Related

How to tell Visual Studio Code compiled from source where to find sqlite module?

I am building the Visual Studio Code from the source checked out from the git repository:
git clone https://github.com/microsoft/vscode
I am building using:
export NODE_OPTIONS=--max_old_space_size=2048
./scripts/npm.sh install --arch=armhf
./scripts/code.sh
I am using node 10.16.3 on a Raspberry PI 4, using Raspbian buster
There were no errors during build.
The installation downloads a precompiled version of electron on the first run.
However each time I try and run code, it starts but with an error:
[storage state.vscdb] open(): Unable to open DB due to Error: Cannot find module '../build/Release/sqlite
If I look in node_modules/vscode-sqlite3/build/Release/
I can see:
sqlite3.a
sqlite.a
It is unclear to me why electron/vscode cannot find this library. I would be greatful for any pointers on how to tell the runtime where to look for the modules.
On inspecting the build scripts and after many painful experiments, I've found and solved the 2 problems leading to this error.
The fact that .a static libraries are left behind hinted that some settings in the binding.gyp, config.gpy and/or makefiles are wrong, as Native Node Modules are normally dynamic libraries with an .node extension. One conditional line in the binding.gyp file under vscode-sqlite3 seems to the the culprit:
...
["target_arch=='arm'", {"type": "static_library"}]
...
Disable that line (by removing it or changing 'arm' to something else) and then run:
node-gyp configure
to regenerate the config.gpy file(s) under the build directory. Then build the module with:
node-gyp build
A sqlite.node will be generated in build/Release.
Unfortunately, the latest electron ABI version rarely matches that of the Node.js version. In my configuration, the electron ABI version is 72 (v6.0.12) but the latest stable Node version is for ABI 64. Therefore we have to do an electron-rebuild to update the sqlite.node to match the electron version.
To do this, you would have to first install electron-rebuild (yarn add electron-rebuild) then run electron-rebuild by giving supplying explicitly the version number of the electron binary that vscode downloaded:
electron-rebuild -v 6.0.12 -m /home/dev/vscode -o vscode-sqlite3
Of course you would have to state the version number of your particular version of electron you are building for.
(Please look up electron-rebuild --help for the meaning of the options. It takes a while to rebuild the binary module...)
The resulting sqlite.node can then be moved into the build/Release/. directory under the vscode project directory. Voila, we have a working latest version VS-Code for Raspbian!

Unable to run corda tests from IntelliJ

When I select and run a test, the build fails with the message:
"Kotlin: Usage of '#JvmDefault' is only allowed if the flag -Xenable-jvm-default is enabled" for the following files.
corda/serialization/src/main/kotlin/net/corda/serialization/internal/OrdinalIO.kt
corda/serialization/src/main/kotlin/net/corda/serialization/internal/SerializationFormat.kt
corda/serialization/src/main/kotlin/net/corda/serialization/internal/amqp/AMQPSerializer.kt
I have cloned corda from my fork of corda/corda on github, and am on branch master, opened in IntelliJ as per instructions on the docsite. The JDK version is 1.8.0_152 and the Kotlin plugin is on version 1.2.41. I see that the -Xenable-jvm-default is enabled in the corda/build.gradle file. There are no local changes. Could you please advise on what I missed or need to do to fix this?
This can be fixed by invalidating IntelliJ's caches and restarting IntelliJ. See jetbrains.com/help/rider/Cleaning_System_Cache.html.
Make sure you are using the gradle runner to execute the tests on IntelliJ.
Navigate to Build, Execution, Deployment -> Build Tools -> Gradle -> Runner (or search for runner)
Windows: this is in “Settings”
MacOS: this is in “Preferences”
Set “Delegate IDE build/run actions to gradle” to true
Set “Run test using:” to “Gradle Test Runner”

Cordova plugin whitelist error causes meteor (and then mup) to fail

When running a meteor.js app via meteor run --verbose android I get this error:
Failed to install 'cordova-plugin-whitelist':Cannot find plugin.xml
for plugin "cordova-plugin-whitelist". Please try adding it again.
I've tried the fix suggested here (installed cordova plugin via add cordova-plugin-whitelist in the folder .meteor/local/cordova-build) and this got the emulator started but then this error appeared:
Execution failed for task ':processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
I found some information about this one on the issues gitHub site for meteor, but I'm at a loss now for what to do.
These errors (not surprisingly) also cause meteor-up deployment to fail. I
tried adding buildOptions: { "serverOnly": true } to the mup.json file per the mup docs but this failed to stop meteor from building the cordova architecture. Is there is a build setting or flag for mup deploy or meteor build so that it doesn't try to build the web.cordova architecture at all?

Grunt build fails in travis - "Cannot find any-promise implementation"

I'm using travis to test my code. Recently the grunt tasks have started to fail without no change being made to anything involved with grunt. (The new commit which is tested contains just very minor changes in two PHP files.)
Here is the part of log from travis:
$ grunt build:app
Running "typings:default" (typings) task
Warning: Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register")("bluebird") on application load prior to any require("any-promise"). Use --force to continue.
Aborted due to warnings.
The command "grunt build:app" exited with 3.
I tried to search for that warning message but couldn't find anything useful.
One more thing: When I run grunt build:app locally on my pc it works just fine.
Thanks for your time :)
I had the same problem when I started using grunt-typings. Worked locally and didn't work on my CI server. Ended up fixing it by doing what the error message suggests:
npm install bluebird
npm install any-promise
In GruntFile.js:
require("any-promise/register")("bluebird");
Update your node.js version to >v0.12. To check your version of node.js use node -v. The documentation of any-promise explains:
Node.js versions prior to v0.12 may have contained buggy versions of the global Promise. For this reason, the global Promise is not loaded automatically for these old versions. If using any-promise in Node.js versions versions <= v0.12, the user should register a desired implementation.

publish-for-arch issues in meteor

I've created package and published it, It is just a simple wrapper of "phantom"
I deployed it using
sudo meteor publih --create
then added it to my app
$> meteor show sasi513:phantom#1.0.0
Version 1.0.0 : phantom node Package wrapper
Architectures: os.linux.x86_32+web.browser+web.cordova
Maintained by sasi513.
EDIT
Then when I try to deploy it meteor deploy xxx.meteor.com
Errors prevented deploying:
While building the application:
error: Unable to download package builds for this architecture.
and I tried to publish-for-arch
sudo meteor publish-for-arch sasi513:phantom#1.0.0
sasi513:phantom: updating npm dependencies -- phantom...
Bundling build...
Creating package build...
Uploading build...
Publishing package build...
Error from package server
: Cannot override existing build [403]
What is wrong here?Anyone has idea about this
The documentation says:
You need to run publish-for-arch from a different architecture to
upload a different build.
Are you running the command on a different architecture? Or the same machine? Because running the command on the same machine wont work.[1] Based on your description, it sounds like you didn't try it from the other architecture you want to support.
[1] http://docs.meteor.com/#meteorpublishforarch

Resources