6

I tried downloading OpenSSL-Android. Then run ndk-build which is ndk8c in this case.

I get the error:

process_begin: CreateProcess(NULL, pwd, ...) failed.
d:/Development/android/android-ndk-r8d/build/gmsl/__gmsl:512: *** non-numeric second argument to `wordlist' function: ''.  Stop.

When I apply a fix to __gsml as described here

I get the error:

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Android.mk
d:/Development/android/android-ndk-r8c/build/core/add-application.mk:165: *** Android NDK: Aborting...    .  Stop.

Or is there a binary I can download? I basically just need libcrypto.so.

This is the Android.mk I am using:

LOCAL_PATH := $(call my-dir)

subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
        crypto \
        ssl \
        apps \
    ))

include $(subdirs)
Community
  • 1
  • 1
tmanthey
  • 4,547
  • 6
  • 35
  • 42

3 Answers3

9

1.) as Bad Design pointed correctly out the __gsml error is fixed by the following AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.evotegra.aCoDriver"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="14"
          android:targetSdkVersion="17"
          android:maxSdkVersion="17" />

</manifest>

2.) The error:

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Android.mk

is caused by the line

APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk

in jni/Application.mk . On Windows the variable $APP_PROJECT_PATH is not set and for that reason it is looking in the root directory for th Android.mk.

This can be fixed by changing the file jni/Application.mk to the following:

LOCAL_PATH := $(call my-dir)
NDK_TOOLCHAIN_VERSION=4.4.3
APP_PROJECT_PATH := $(shell pwd)
APP_BUILD_SCRIPT := $(LOCAL_PATH)/../Android.mk
tmanthey
  • 4,547
  • 6
  • 35
  • 42
4

If you get the following error after you run ndk-build:

android-ndk-r8d/build/gmsl/__gmsl:512: *** non-numeric second argument to `wordlist' function: ''.  Stop.

you should add at least "android:minSdkVersion" inside the AndroidManifest.xml file:

<uses-sdk android:minSdkVersion="14"
          android:targetSdkVersion="17"
          android:maxSdkVersion="17" />

If you want to fix the second error I think you should remove the leading "/" from "/Android.mk" at ,$(addsuffix /Android.mk

EDIT: I tried building the OpenSSL library for Android project from the Github page you linked and it worked, after I changed AndroidManifest.xml file to something like below:

Note: I'm using android-ndk-r8d on a GNU/Linux distribution and I ran ndk-build from the root of the project.

You don't have to remove the leading "/".

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.jp.algi"
      android:versionCode="1"
      android:versionName="1.0">

      <uses-sdk android:minSdkVersion="14"
          android:targetSdkVersion="17"
          android:maxSdkVersion="17" />

    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="MyJpAndroidAppActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
Alex Bitek
  • 6,529
  • 5
  • 47
  • 77
  • I tried, but it ain't work out. The relevant line in Android.mk now looks `code`subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix Android.mk, \# – tmanthey Jan 26 '13 at 09:38
  • Try to build the files using the following command. This will force complete rebuild and it'll show the commands that the ndk-build script is executing. (i.e. verbose mode) `ndk-build -B V=1` Also make sure you use the latest Android NDK - android-ndk-r8d – Alex Bitek Jan 26 '13 at 09:41
  • Using the manifest fixes the __gsml error. But this stupid missing file error remains. This is the output `D:\Development\libs\openssl-android-master>d:\Development\android\android-ndk-r8 d\ndk-build -B V=1 process_begin: CreateProcess(NULL, pwd, ...) failed. Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /Android.mk d:/Development/android/android-ndk-r8d/build/core/add-application.mk:165: *** An droid NDK: Aborting... . Stop.` – tmanthey Jan 26 '13 at 09:55
  • As you are on Windows, replace "/"es with "\"es – Alex Bitek Jan 26 '13 at 09:57
  • I tried both `subdirs := $(addprefix $(LOCAL_PATH)\,$(addsuffix Android.mk, \ ` and `subdirs := $(addprefix $(LOCAL_PATH)\,$(addsuffix \Android.mk, \ ` but the error remains – tmanthey Jan 26 '13 at 10:05
  • I think the makefiles in the Android NDK are filesystem independent, you still get the error if you use the initial contents inside Android.mk? `subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \ crypto \ ssl \ apps \ ))` – Alex Bitek Jan 26 '13 at 10:22
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/23411/discussion-between-tmanthey-and-bad-design) – tmanthey Jan 26 '13 at 14:35
4

I used the command dos2unix AndroidManifest.xml and it clears up the error for me. I hope that helps

luckyreed76
  • 185
  • 2
  • 8