Getting error while running command "flutter build --release" - android

The android studio builds the apk perfectly with the following command : "flutter build apk" but is throwing error when I try to run "flutter build apk --release".
The following error is thrown in the terminal:
Codepoint 983896 not found in font, aborting.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter_windows_2.10.1-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\flutter_windows_2.10.1-stable\flutter\bin\flutter.bat'' finished with non-zero exit value 1
Here is the image of the error:
android studio terminal error
Note: The app is running perfectly on emulator and my physical device in debug mode and profile mode

Related

React-native fails to sign release build

Hello i recently got this error while running npx react-native run-android --variant=release --no-jetifier
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key my-key from store "/Users/ad8kunle/Documents/react-native-projects/mvmarket/android/app/my-upload-key.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available
It used to work fine, not sure what went wrong. Debug version runs fine.
GRADLE 7.3.3
REACT - NATIVE 8.6.0

flutter build apk giving error "Execution failed for task ':app:mergeReleaseResources'." on jenkins

I am getting below exception when i build my flutter project on jenkins
C:\ProgramData\Jenkins\.jenkins\workspace\automated test app>flutter build apk
Building with sound null safety
Running Gradle task 'assembleRelease'...
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> Multiple task action failures occurred:
> A failure occurred while executing
com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_low_normal.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_low_pressed.9.png: AAPT: error: file not found.
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 1m 25s
Running Gradle task 'assembleRelease'... 86.2s
Gradle task assembleRelease failed with exit code 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
I am faced with this problem with Gitlab ci/Runner on Windows 10 and i stucked with all day.
The problem is that I have not installed Gitlab-Runner with privileges windows with my user account before :
cd C:\GitLab-Runner
.\gitlab-runner.exe install
.\gitlab-runner.exe start
But after, I installed Gitlab-Runner using my user account. The problems no longer occurs.
cd C:\GitLab-Runner
.\gitlab-runner.exe install --user ".\USERR" --password "MYPASSWORD"
.\gitlab-runner.exe start
So, I think maybe your problem is that you are not running the script with a privileges.
The fact that I saw this because when I tried to access the image file.
For example : C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\846e5094a0f0114af067375a609d094e\transformed\core-1.6.0\res\drawable-mdpi-v4\notification_bg_normal.9.png
I'm not able to reach the "C:\Windows\System32" without accepting the privileges administrator windows.
But if I accept as administrator, I can find the image file.

can´t create an apk with an ionic project

Hi im new in ionic and im trying to create an apk to in order to test my qr scanner project, but when I run the command ionic cordova build android --release
i got the following error output:
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:processReleaseManifest FAILED
BUILD FAILED
Total time: 13.446 secs
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:19:5-65 Error:
Element uses-permission#android.permission.CAMERA at AndroidManifest.xml:19:5-65 duplicated with element
declared at AndroidManifest.xml:16:5-90
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml:21:5-84 Error:
Element uses-feature#android.hardware.camera at AndroidManifest.xml:21:5-84 duplicated with element declared at
AndroidManifest.xml:17:5-85
C:\Users\delacrga\Ionic projects\myApp\platforms\android\AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Could someone helpme with this?
output:
C:\Users\delacrga\Ionic projects\myApp>ionic cordova build android --prod --release -- -- --keystore=filename.keystore --alias=myalias
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser
[08:52:04] build prod started ...
[08:52:04] clean started ...
[08:52:04] clean finished in 10 ms
[08:52:04] copy started ...
[08:52:04] ngc started ...
[08:52:15] ngc finished in 11.48 s
[08:52:15] preprocess started ...
[08:52:16] deeplinks started ...
[08:52:16] deeplinks finished in 63 ms
[08:52:16] optimization started ...
[08:52:16] copy finished in 11.85 s
[08:52:26] optimization finished in 10.47 s
[08:52:26] preprocess finished in 10.54 s
[08:52:26] webpack started ...
[08:52:32] webpack finished in 5.46 s
[08:52:32] sass started ...
[08:52:32] uglifyjs started ...
[08:52:33] sass finished in 1.22 s
[08:52:33] cleancss started ...
[08:52:35] cleancss finished in 1.93 s
[08:52:42] uglifyjs finished in 10.23 s
[08:52:42] postprocess started ...
[08:52:42] postprocess finished in 15 ms
[08:52:42] lint started ...
[08:52:42] build prod finished in 37.83 s
> cordova build android --release -- --keystore=filename.keystore --alias=myalias
× Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android --release -- --keystore=filename.keystore --alias=myalias
(exit code 1):
ANDROID_HOME=C:\Users\delacrga\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use
Task.doLast(Action) instead.
at build_amlj4yw9chmdse17z8bfqqws2.run(C:\Users\delacrga\Ionic
projects\myApp\platforms\android\build.gradle:139)
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289
* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.175 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\delacrga\Ionic projects\myApp\platforms\android\build.gradle' line: 289
* What went wrong:
A problem occurred evaluating root project 'android'.
> Keystore file does not exist: C:\Users\delacrga\Ionic projects\myApp\platforms\android\..\..\filename.keystore
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
By any chance if you have two different plugins installed which asks permission for the camera i.e. cordova-plugin-qrscanner and phonegap-plugin-barcodescanner together, it will cause this issue.
Remove either of the plugin by
ionic cordova plugin remove phonegap-plugin-barcodescanner
or
ionic cordova plugin remove cordova-plugin-qrscanner
Yes.#Jay is right. Because my ionic project have two different plugins installed which asks permission for the camera. cordova-plugin-qrscanner and cordova-plugin-cszbar,Remove either of the plugin then working.

Error in react-native-i18n while generate apk from react-native in Jenkins

I have the error:
:react-native-i18n:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-i18n:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
When I want to generate my application from react-native use my Jenkinsfile script.
dir('src/Mobile/android'){
sh 'chmod +x ./gradlew'
sh 'ANDROID_HOME=/home/user/android ./gradlew assembleDefault'
archive '*/build/outputs/apk/*.apk'
I can run the application in the local environment but my server with Jenkins can't build my App. Any idea how to solve this problem?

angular2 cordova android failing to run in emulator

I setup a basic angular2 app in cordova, it runs fine in iOS but with android I'm getting build failed with an exception, I can run android fine in a basic cordova app.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/opt/android-sdk/build-tools/24.0.2/aapt'' finished with non-zero exit value 1
Error: /Users/username/Code/workshop/cordova/angular-2/MyApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
ok i resolved the issue which was caused by node_modules folder being too heavy for the emulator to launch, i cut a lot of fat from node_modules (i.e deleted dependencies and other fluff that wasn't needed) and increased the resources available to the avd.
things ran smooth after that :)

Categories

Resources