Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7737641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:03:15+00:00 2026-06-01T08:03:15+00:00

I have a simple Android.mk file: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) $(shell ($(LOCAL_PATH)/echo_test.sh))

  • 0

I have a simple Android.mk file:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

$(shell ($(LOCAL_PATH)/echo_test.sh))

LOCAL_MODULE := libecho_test
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

The interesting thing that it does is to call the ‘echo_test.sh’ bash script. In the case when the contents of the script are

#!/bin/bash
echo 'echo is working' >&2

or

#!/bin/bash
echo 'echo is working' >/dev/null

everything is OK.

Things go wrong when the bash script is

#!/bin/bash
echo 'echo is working'

or

#!/bin/bash
echo 'echo is working' >&1

Then the returned error is

Android.mk:4: *** missing separator.  Stop. 

This happens both with Android NDK 7 and when you include this module during the build of Android Ice Cream Sandwich 4.0.3.

I really can’t understand what’s the deal with the standard output and the Android build system. Does anyone have an explanation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:03:16+00:00Added an answer on June 1, 2026 at 8:03 am

    The Android NDK build system is actually GNU Make. All of the code in the Android.mk file has to be valid make.

    When you run $(shell) and don’t store the value in a variable, then it is as if you copied the standard output of the script into your Android.mk file. i.e. it is as if your file contained the following:

    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    
    echo is working
    
    LOCAL_MODULE := libecho_test
    LOCAL_MODULE_TAGS := optional
    include $(BUILD_SHARED_LIBRARY)
    

    .. which is not valid make syntax. Redirecting to >&2 in your script works because the output goes to the error output and is then shown on the console.

    As Vishrut mentions, use $(info) or $(warning) to print messages. Or if you really want to run a script during the build, store its output in a variable:

    ECHO_RESULT := $(shell ($(LOCAL_PATH)/echo_test.sh))
    

    Here you won’t see the echo output of the script, it goes into the variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Android application that uses a JAR I have built. When
I have a simple android app to play videos. I have a main screen
I have a simple question. I am trying to design a simple Android app,
So I have a very simple android activity that starts a timer when you
I have created a small and simple android app. I tried installing it on
I have a simple client-server app on android. the android service communicates with the
I have to make a simple layout in android but have problem with the
I have a very simple dialog defined as: import android.app.AlertDialog; import android.content.Context; import android.view.LayoutInflater;
I have a fairly simple android app, it gets protobuf data from a web
I'm working on a relatively simple Android app. I want it to have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.