React-native Task :app:processDebugMainManifest FAILED - node.js

When I'm creating a new react-native app, then trying to run it on android emulateur, I'm getting this error. I tried all the solutions offered on google but without success... I followed all the documentation and started all over again several times but still this problem.Here are the screenshots of my info :

I found the solution ! (Windows)
Steps one : Go to C:\Users\yourname.gradle and delete all folders.
Step two : Check that the anti virus is not in silent mode (very important)
Step tree : Create your new project : npx react-native init myAwesomeProject and authorize every file catch by the anti virus ! Then it will work.
If still doesn't work, open in android studio the android folder of your project, let it build everything, start your project from a terminal and run the project from your android studio application.

Related

Android studio is giving the following error when I am trying to build a ionic project "Gradle sync failed: Sync failed: reason unknown"

I am trying to build a ionic project in Android studio on Ubuntu 20.04 . I am using the command ionic capacitor build then android studio opens up as expected then it shows this error Gradle sync failed: Sync failed: reason unknown. I am unable find a solution for this particular gradle sync error. I have reinstalled Ubuntu and other things but still the problem persists.
In my case, a fresh install of Android Studio resulted in Android 31 being the only SDK available but the project was targeting Android 30. I went to Tools > SDK Manager and made sure the appropriate version of Android SDK was installed and available. After restarting, and allowing the gradle sync to complete I was able to build/run the app on a virtual device, etc.
Here is what I found
This is the screenshot thanks for helping.
Capacitor lets you manage your own Android project. Like any IDE-backed project, sometimes things get so out of sync that the only solution is to rebuild the project.
To do this, follow these steps:
Copy any source code you created (such as Java files in app/android/src, manifest files, or resource files) into a safe location outside of app/android.
Next, make sure you are running an updated version of the Capacitor CLI:
npm install #capacitor/cli#latest
Remove the android directory:
rm -rf android/
Re-create the Android app from Capacitor:
npx cap add android
Copy your saved source files back into the project.
Check the error log. You should find something like "Module: 'mobile' platform 'android-30' not found" or something similar. Click Tools > SDK Manager and download the appropriate Android SDK Platform package.
on top right you will see option to view log file upon clicking there you will redirect to file manager and open idea file there
example :
open idea file and scroll down you will see actual issue.
In my case android sdk 31 was not installed.
I installed android sdk 31 from File>Settings>Apprearance and behaviour>system settings>android sdk and install required android sdk and rebuild the project.
accord to my observation in most cases you get this error because you have not required sdk installed in your system.

android studio error - Could not determine the dependencies of task ':app:installDebug'

While running the React Native Android app, then building the project the following error is shown:
Could not determine the dependencies of task ':app:installDebug'.
Go to android folder in your project and then type
gradlew clean for Windows and
./gradlew clean for Mac and Linux. I use this method every time I encounter the same problem, and also when changing the package.json (add / remove library)
Please remove build folder in /android/app and run build command again.
It worked for me.

Ionic 5 capacitor android project not sync

Android studio keeps building and install the first android project into the device.
I have tried
npx cap sync
npx cap copy android
Even delete the /android folder and add it again. The project still remains as the first time I added into the android studio. I have tried 'Gradle sync' and 'Invalidate cache /restart' still no luck.
I have update my project resource icon and splash to a customized one, but the android project still using the capacitor default icon and splash. Have anyone face this issue before?
I found the solution!
I notice the npx sync is copying data from the www folder. Thus, I think I need to update the www folder first before sync. Thus I use the
ionic build
Command, to build all the files into www and run
npx cap sync
npx cap open android
Tada, android project is updated.
Every time you perform a build (e.g. ionic build) that changes your web directory (default: www), you'll need to copy those changes down to your native projects:
ionic build or npm run build
npx cap copy
npx cap open android
reference : https://capacitor.ionicframework.com/docs/getting-started/with-ionic
if you are using the ionic commands the all you have to do is call ionic capacitor sync... it will do all of the building and the copying of assets
https://ionicframework.com/docs/cli/commands/capacitor-sync

Could not install app on device, react-native

I am extremely new to app development. I am facing the following error during the installation of my app on emulator by using the CLI:
Error Message on the Terminal:
Following are the details of my project:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
I don't know what is causing this, and I have tried deleting the gradle (version 2.14.1) multiple times and zipping it again inside the 'gradle' folder. Still It does not seem to be resolved.
How can I solve the problem?
I have the same problem as yours! Because when I first run "react-native run-android", my INTERNET is SLOW and LAG, CORRUPTED. This bad internet connection lets to download a TEMPORARY DAMAGE file gradle....zip.
Solution: The gradle-2.14.1-all.zip was damaged,so it should be replaced with a new gradle-2.14.1-all.zip
Then go to android folder of your react native application
./gradlew clean
Try running the application again

Compile mapsforge jar files download from github - Android Studio

I've started a new project in android Studio because for me it seemed the most obvious thing to do, compile mapsforge so I can use it in my next project create an App .
My first steps :
Via Android Studio : File > New > Project from version control
Download mapsforge from Github : https://github.com/mapsforge/mapsforge.git
After above steps this is my result
Opened and take look at the existing build.gradle file... aaaaargh
Ignore the whole gradle stuff, just goto : Build > Make Project Ctrl + F9 ... executing taks and gradle build finished, no errors , Nice !
Questions:
Where is the path where the jar files are generated / copied to? How to configure it? In AndroidStudio OR ignore this and just focus on the gradle.build script?
Note:
It's not about programming or developing its about environment configuration.
So I really struggle with gradle, never used it before, started watching tutorials/demos, read stuff about it, ! I know rtfm ! Im missing out on some helpfull documentation.
I just want to compile and generate the jars (one time only) and use them in my App, thats it...

Resources