Building ionic on ubuntu 16.04 falied

:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources/opt/android-sdk/build-tools/26.0.2/aapt: 1: /opt/android-sdk/build-tools/26.0.2/aapt: Syntax error: "(" unexpected

 FAILED

FAILURE: Build failed with an exception.

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

* 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: 2.755 secs
Error: /home/vicsoft/Desktop/nyscPrjct/platforms/android/gradlew: Command failed with exit code 1 Error output:
/opt/android-sdk/build-tools/26.0.2/aapt: 1: /opt/android-sdk/build-tools/26.0.2/aapt: Syntax error: "(" unexpected


FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

i’ve tried to remove android platform and add it again and also tried to update sdk manager…all was to no avail…please kindly assist me on this issue…i have been on it for some days now…i need to roll out my project for testing but this keep delayin me…

Please edit your post, it is not very readable at the moment.
Use the </> button above the input field to format your code, command line output or error message (select the text first, then click the button or wrap it in ``` manually). Check the preview if it looks better. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

What is your ionic info output?
What command are you running that gives you this error?

thank you @sujan12… i’m running cordova build android and i’m getting the errors posted…

:CordovaLib:processDebugResources/opt/android-sdk/build-tools/26.0.2/aapt: 1: /opt/android-sdk/build-tools/26.0.2/aapt: Syntax error: "(" unexpected

 FAILED

FAILURE: Build failed with an exception.

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

* 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: 28.952 secs
Error: /home/vicsoft/Desktop/nyscPrjct/platforms/android/gradlew: Command failed with exit code 1 Error output:
/opt/android-sdk/build-tools/26.0.2/aapt: 1: /opt/android-sdk/build-tools/26.0.2/aapt: Syntax error: "(" unexpected


FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

this is the ionic info output below:

cli packages: (/home/vicsoft/Desktop/nyscPrjct/node_modules)

    @ionic/cli-utils  : 1.13.1
    ionic (Ionic CLI) : 3.13.2

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 2.0.2
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.5.3

System:

    Node : v6.11.3
    npm  : 3.10.10 
    OS   : Linux 4.10

Misc:

    backend : legacy

This is not a ionic command, so you are asking in the wrong place…
Do you get the same output with ionic cordova build android? Post the complete output please.

This is old and should be updated.

Do you get the same error when you try to build a new project created with ionic start?
Have you tried removing and re-addding the android platform?

i do get same error when i tried to build a new project with ionic start
i’ve tried to remove and re-add android platform…

What does ionic cordova requirements return?

This is response from  **ionic cordova requirements**
> cordova requirements

Requirements check results for android:

Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-26,android-25,android-24,android-23,android-21,android-19
Gradle: installed /usr/lib/gradle/4.2/bin/gradle

Strange, no idea what is going on:

No info where exactly there is this syntax error :confused:

That’s serious then…is this how i’m gonna loose my project that i’ve completed and just to roll out for testing…

The project is probably fine, this is a pure build problem.
Check out the project on another computer and try there.
You might also try re-installing Android Studio and SDK on your computer.

i know the error is from android studio and sdk…but i couldn’t figure it out…