Build a release android app cause error in ionic3


#1

I have try to build a ios and android app for production. When I build ios, everything is fine. But when I build android for production, it have error now:

(node:1861) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
Error: /Users/xxxxxxxxx/Downloads/xxxxxx/platforms/android/gradlew: Command failed with 
exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
warning: string 'com_facebook_loginview_log_in_button_continue_f1gender' has no default 
translation.
warning: string 'com_facebook_loginview_log_in_button_continue_m2gender' has no default 
translation.
warning: string 'com_facebook_loginview_log_out_action_f1gender' has no default translation.
warning: string 'com_facebook_loginview_log_out_action_m2gender' has no default translation.
warning: string 'com_facebook_loginview_log_out_button_f1gender' has no default translation.
warning: string 'com_facebook_loginview_log_out_button_m2gender' has no default translation.
warning: string 'com_facebook_loginview_logged_in_as_f1gender' has no default translation.
warning: string 'com_facebook_loginview_logged_in_as_m2gender' has no default translation.
warning: string 'com_facebook_loginview_logged_in_using_facebook_f1gender' has no default 
translation.
warning: string 'com_facebook_loginview_logged_in_using_facebook_m2gender' has no default 
translation.
warning: string 'com_facebook_send_button_text_f1gender' has no default translation.
warning: string 'com_facebook_send_button_text_m2gender' has no default translation.
warning: string 'com_facebook_share_button_text_f1gender' has no default translation.
warning: string 'com_facebook_share_button_text_m2gender' has no default translation.
warning: string 'com_facebook_smart_login_confirmation_cancel_f1gender' has no default 
translation.
warning: string 'com_facebook_smart_login_confirmation_cancel_m2gender' has no default 
translation.
warning: string 'com_facebook_smart_login_confirmation_continue_as_f1gender' has no default 
translation.
warning: string 'com_facebook_smart_login_confirmation_continue_as_m2gender' has no 
default translation.
warning: string 'com_facebook_smart_login_confirmation_title_f1gender' has no default 
translation.
warning: string 'com_facebook_smart_login_confirmation_title_m2gender' has no default 
translation.
warning: string 'com_facebook_tooltip_default_f1gender' has no default translation.
warning: string 'com_facebook_tooltip_default_m2gender' has no default translation.
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute 
android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt

My ionic info is:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.0.1
Cordova Platforms  : android 6.3.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.8.0

System:

ios-deploy : 1.9.2 
Node       : v7.10.0
npm        : 5.5.1 
OS         : macOS Sierra

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

My Android studio info:

version: 2.3.3
android build tools: Android SDK Build-Tools 28-rc1

How to solve the problem, Many thanks, I am stuck in this problem for a days, so frustrated.


#2

Your Cordova tooling seems to be out of date, which might be causing all kinds of problems. The current version of the Android platform is 7.1.0.
You can read about how to figure out the current Cordova versions and how to update CLI, platforms and plugins here: https://ionic.zone/cordova/update


#3

Hi, but i used android 6.3.0 and android studio 2.3.3 to build production app successfully. Now the error ocurr is after I update my android studio to 3.0.0 accidents, so I try to downgrade the android studio to 2.3.3 but the error still here, any suggestion? Thanks


#4

Updating Android Studio probably also updated your Android SDK, your local gradle and other stuff. It is best to work with the newest stuff - or spend some time debugging and fiddeling with the old, outdated ones :confused: