Ionic Build Android Error Code 1 - ionic-framework

I created a brand new Ionic starter blank app. After I added the android platform, I did the "build android" command and receiving this:
"What went wrong:
Execution failed for task ':preDexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:"
With it saying "Error Code 1" and output some java stuff (version 52.0).
The last of it says "Error code 1 for command: cmd with args: /s /c "c:\users....\app\platforms\android\gradlew cdvBuildDebug..
Any ideas how to fix it? I've tried downloading gradle zip and changing it to local, removing and readding android platform, and nothing has worked.

Related

FAILURE: Build failed with an exception. flutter.gradle' line: 904

FAILURE: Build failed with an exception.
Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1
I tried flutter clean / pug get and update but application is still not working.
Try this:
flutter clean
flutter pub get
Once these two commands have been successfully executed, launch your project ... This is what I did and it worked.
try running
flutter clean
flutter upgrade
it work for me.
In Android Studio I did the following:
flutter clean
flutter pub get
Invalidate Caches and Restart (from the File menu)
After all that, I re-ran the flutter build appbundle command and it worked.
My antivirus was blocking dart from reading asset images, i allowed it from there and the error got fixed!!
I've had the same error and tried the following:
uninstall android studio and delete all folders regarding this
clean up registry
review path for environment variables
give all sorts of flutter commands (clean, update, and so on)
Until I realized this is an error on the flutter folder, so basically this is due to some force close some operations and the variables that write in the 'flutter.gradle' file are obsolete. What I did and worked for me:
Make sure you have all android studio processes closed.
Delete the flutter folder (the one that you defined as for the PATH)
Extract in the same location the flutter folder from the SDK archive.
Enjoy :)
Powershell commands Example:
Remove-Item 'D:\DEV\flutter'
Expand-Archive -LiteralPath 'C:\Archives\flutter_windows_1.22.3-stable.Zip' -DestinationPath D:\DEV

why do I get Gradle task assemble Debug failed error

I imported a flutter project from GitHub. when I tried to run it I had this error(no errors in code). I could not figure out what this error is all about and I keep getting this error for every project which I import from GitHub.Please help me out!
This is the error:
Exception in thread "main" java.util.zip.ZipException: error in opening zip file.
Gradle threw an error while trying to update itself. Retrying the update...
Finished with error: Gradle task assembleDebug failed with exit code 1.
It's kinda common problem when you get a project from github and I solved it once with this answer.
Copy paste from there:
Open your Android Studio preferences(Command + ',') and go to
Languages and Frameworks -> Dart
Check "Enable Dart support for the project your_project_name"
In "Dart SDK path" click in "…" and navigate to flutter SDK directory.
Under that directory you'll find "bin/cache/dart-sdk". This is the
dart sdk path you should use.
Click "Apply"
flutter packages get
flutter run

Why do I get the Error: ADB exited with exit code 1

If I want to start a simple app, which I used a few weeks ago without an error, I get an error.
That´s he error discription:
Launching lib\main.dart on SM J530F in debug mode...
Running Gradle task 'assembleDebug'...
Parameterformat falsch -
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install C:\Users\Simon\Desktop\App Entwickeln\Projekte\test_app\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
Error launching application on SM J530F.
From: Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on Android
Solution Run:
adb shell "pm uninstall " adb shell "rm -rf
/data/app/-*"
OR
Uninstall the app
Use your favorite method to delete BOTH:
/data/app/-1.apk
/data/app/-2.apk
Make sure nothing else blocks future installs in a similar way. In my
case I had a /data/app-lib/-1 directory lingering
around! In this case, an install to the SD card worked, and a
subsequent move to internal memory, too. (Creating
/data/app-lib/ without the -1 ending.)
For me the second solution worked!
I had the same Problem and the solution is deleating something from your device. The Problem is, that the storeg is full

Flutter : How to fix 'Gradle task assembleDebug failed with exit code -1'?

I just started using flutter on vscode and the Android emulator is connected to vscode. when I run the first flutter code by pressing f5 is not running, and on the console it says:
Launching lib\main.dart on Samsung in debug mode...
Gradle task assembleDebug failed with exit code -1
Exited (sigterm)
when I run it using intellij sometimes it works and sometimes it fails like the problem above. how do you solve the problem with vscode? intellij is too heavy for my computer.
This is a grade problem, and could be hard for you to debug without getting sufficient info on the problem
cd into your android directory
then
run ./gradlew build
you should be able to get the cause of the failed build

Flutter sample build issue

I am getting this error when trying to run the sample first_app in flutter after opening it in VS CODE.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/ts/Documents/Dev/first_app/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder information, or similar
detritus not allowed
Command /usr/bin/codesign failed with exit code 1
Could not build the application for the simulator.
Error launching application on iPhone 8.
Does anyone know what could be causing this? Thanks!