Build issues on windows

Issue #44 resolved
David Khachaturov created an issue

So, while building an apk file on Windows, I ran into some problems. The first one being that ndk-build doesn't complete the proccess:

Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersi
on 10 in ./AndroidManifest.xml
[armeabi] Compile thumb  : devil <= il_fastconv.c
[armeabi] Compile thumb  : devil <= il_files.c
[armeabi] Compile thumb  : devil <= il_fits.c
[armeabi] Compile thumb  : devil <= il_ftx.c
[armeabi] Compile thumb  : devil <= il_gif.c
[armeabi] Compile thumb  : devil <= il_hdr.c
[armeabi] Compile thumb  : devil <= il_header.c
[armeabi] Compile thumb  : devil <= il_icns.c
[armeabi] Compile thumb  : devil <= il_icon.c
[armeabi] Compile thumb  : devil <= il_iff.c
[armeabi] Compile thumb  : devil <= il_ilbm.c
[armeabi] Compile thumb  : devil <= il_internal.c
[armeabi] Compile thumb  : devil <= il_io.c
[armeabi] Compile thumb  : devil <= il_iwi.c
[armeabi] Compile thumb  : devil <= il_jp2.c
In file included from jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/ja
sper/jasper.h:65:0,
                 from jni/devil-1.7.8/src-IL/src/il_jp2.c:16:
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:107:
0: warning: "PACKAGE" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:305:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:110:
0: warning: "PACKAGE_BUGREPORT" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:308:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:113:
0: warning: "PACKAGE_NAME" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:311:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:116:
0: warning: "PACKAGE_STRING" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:314:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:119:
0: warning: "PACKAGE_TARNAME" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:317:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:122:
0: warning: "PACKAGE_VERSION" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:320:0: note: this is the location of the pre
vious definition
jni/devil-1.7.8/../jasper-1.900.1/src/libjasper/include/jasper/jas_config.h:128:
0: warning: "VERSION" redefined [enabled by default]
jni/devil-1.7.8/include/IL/config.h:351:0: note: this is the location of the pre
vious definition
[armeabi] Compile thumb  : devil <= il_jpeg.c
[armeabi] Compile thumb  : devil <= il_lif.c
... <- There were more successes here
[armeabi] Compile thumb  : tiff <= tif_dirread.c
make.exe: *** Access is denied.
.  Stop.

Secondly, if I just run "ant debug" and install the apk on my device it gives me this error (taken from logcat):

I/ActivityManager(  370): Start proc com.davidobot.pixel for activity com.davido
bot.pixel/.PixelActivity: pid=1178 uid=10052 gids={50052, 3003, 1028, 1015}
W/dalvikvm( 1178): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initi
alizing Lorg/libsdl/app/SDLActivity;
W/dalvikvm( 1178): Class init failed in newInstance call (Lcom/davidobot/pixel/P
ixelActivity;)
D/AndroidRuntime( 1178): Shutting down VM
W/dalvikvm( 1178): threadid=1: thread exiting with uncaught exception (group=0xb
1a96ba8)
E/AndroidRuntime( 1178): FATAL EXCEPTION: main
E/AndroidRuntime( 1178): Process: com.davidobot.pixel, PID: 1178
E/AndroidRuntime( 1178): java.lang.UnsatisfiedLinkError: Couldn't load gnustl_sh
ared from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/
com.davidobot.pixel-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidobo
t.pixel-1, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 1178):        at java.lang.Runtime.loadLibrary(Runtime.java:35
8)
E/AndroidRuntime( 1178):        at java.lang.System.loadLibrary(System.java:526)

E/AndroidRuntime( 1178):        at org.libsdl.app.SDLActivity.<clinit>(SDLActivi
ty.java:52)
E/AndroidRuntime( 1178):        at java.lang.Class.newInstanceImpl(Native Method
)
E/AndroidRuntime( 1178):        at java.lang.Class.newInstance(Class.java:1208)
E/AndroidRuntime( 1178):        at android.app.Instrumentation.newActivity(Instr
umentation.java:1061)
E/AndroidRuntime( 1178):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2112)
E/AndroidRuntime( 1178):        at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2245)
E/AndroidRuntime( 1178):        at android.app.ActivityThread.access$800(Activit
yThread.java:135)
E/AndroidRuntime( 1178):        at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1196)
E/AndroidRuntime( 1178):        at android.os.Handler.dispatchMessage(Handler.ja
va:102)
E/AndroidRuntime( 1178):        at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 1178):        at android.app.ActivityThread.main(ActivityThrea
d.java:5017)
E/AndroidRuntime( 1178):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 1178):        at java.lang.reflect.Method.invoke(Method.java:5
15)
E/AndroidRuntime( 1178):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 1178):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:595)
E/AndroidRuntime( 1178):        at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager(  370):   Force finishing activity com.davidobot.pixel/.PixelA
ctivity
E/gralloc_goldfish(   50): gralloc_alloc: Mismatched usage flags: 328 x 583, usa
ge 333
W/GraphicBufferAllocator(   50): alloc(328, 583, 1, 00000333, ...) failed -22 (I
nvalid argument)
E/        (   50): GraphicBufferAlloc::createGraphicBuffer(w=328, h=583) failed
(Invalid argument), handle=0x0
E/BufferQueue(  370): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createG
raphicBuffer failed
W/WindowManager(  370): Screenshot failure taking screenshot for (328x583) to la
yer 21010
D/dalvikvm(  370): GC_FOR_ALLOC freed 80K, 53% free 6146K/12848K, paused 70ms, t
otal 71ms
I/dalvikvm-heap(  370): Grow heap (frag case) to 7.146MB for 1127536-byte alloca
tion
D/dalvikvm(  370): GC_FOR_ALLOC freed 2K, 49% free 7244K/13952K, paused 74ms, to
tal 74ms
D/dalvikvm(  370): GC_CONCURRENT freed 4K, 49% free 7241K/13952K, paused 7ms+15m
s, total 261ms
W/ActivityManager(  370): Activity pause timeout for ActivityRecord{b1e26658 u0
com.davidobot.pixel/.PixelActivity t4 f}
D/        (  370): HostConnection::get() New Host Connection established 0xb71e5
9e8, tid 385
W/EGL_emulation(  740): eglSurfaceAttrib not implemented
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressStandard.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressSpacebar.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressDelete.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressReturn.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressInvalid.ogg
W/AudioService(  370): onLoadSoundEffects(), Error -1 while loading samples
I/Process ( 1178): Sending signal. PID: 1178 SIG: 9
W/InputMethodManagerService(  370): Window already focused, ignoring focus gain
of: com.android.internal.view.IInputMethodClient$Stub$Proxy@b1dc2b20 attribute=n
ull, token = android.os.BinderProxy@b221fed8
I/ActivityManager(  370): Process com.davidobot.pixel (pid 1178) has died.
D/InitAlarmsService( 1001): Clearing and rescheduling alarms.
I/MediaFocusControl(  370):  AudioFocus  abandonAudioFocus() from android.media.
AudioManager@b1d76ab0com.android.music.MediaPlaybackService$3@b1d75930
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressStandard.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressSpacebar.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressDelete.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressReturn.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressInvalid.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressInvalid.ogg
W/AudioService(  370): onLoadSoundEffects(), Error -1 while loading samples
I/ActivityManager(  370): START u0 {act=android.intent.action.MAIN cat=[android.
intent.category.LAUNCHER] flg=0x10200000 cmp=com.davidobot.pixel/.PixelActivity}
 from pid 740
E/gralloc_goldfish(   50): gralloc_alloc: Mismatched usage flags: 328 x 583, usa
ge 333
W/GraphicBufferAllocator(   50): alloc(328, 583, 1, 00000333, ...) failed -22 (I
nvalid argument)
E/        (   50): GraphicBufferAlloc::createGraphicBuffer(w=328, h=583) failed
(Invalid argument), handle=0x0
E/BufferQueue(  370): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createG
raphicBuffer failed
W/WindowManager(  370): Screenshot failure taking screenshot for (328x583) to la
yer 21005
I/dalvikvm(  370): Jit: resizing JitTable from 4096 to 8192
D/dalvikvm( 1201): Not late-enabling CheckJNI (already on)
I/ActivityManager(  370): Start proc com.davidobot.pixel for activity com.davido
bot.pixel/.PixelActivity: pid=1201 uid=10052 gids={50052, 3003, 1028, 1015}
W/dalvikvm( 1201): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initi
alizing Lorg/libsdl/app/SDLActivity;
W/dalvikvm( 1201): Class init failed in newInstance call (Lcom/davidobot/pixel/P
ixelActivity;)
D/AndroidRuntime( 1201): Shutting down VM
W/dalvikvm( 1201): threadid=1: thread exiting with uncaught exception (group=0xb
1a96ba8)
E/AndroidRuntime( 1201): FATAL EXCEPTION: main
E/AndroidRuntime( 1201): Process: com.davidobot.pixel, PID: 1201
E/AndroidRuntime( 1201): java.lang.UnsatisfiedLinkError: Couldn't load gnustl_sh
ared from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/
com.davidobot.pixel-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.davidobo
t.pixel-1, /system/lib]]]: findLibrary returned null
E/AndroidRuntime( 1201):        at java.lang.Runtime.loadLibrary(Runtime.java:35
8)
E/AndroidRuntime( 1201):        at java.lang.System.loadLibrary(System.java:526)

E/AndroidRuntime( 1201):        at org.libsdl.app.SDLActivity.<clinit>(SDLActivi
ty.java:52)
E/AndroidRuntime( 1201):        at java.lang.Class.newInstanceImpl(Native Method
)
E/AndroidRuntime( 1201):        at java.lang.Class.newInstance(Class.java:1208)
E/AndroidRuntime( 1201):        at android.app.Instrumentation.newActivity(Instr
umentation.java:1061)
E/AndroidRuntime( 1201):        at android.app.ActivityThread.performLaunchActiv
ity(ActivityThread.java:2112)
E/AndroidRuntime( 1201):        at android.app.ActivityThread.handleLaunchActivi
ty(ActivityThread.java:2245)
E/AndroidRuntime( 1201):        at android.app.ActivityThread.access$800(Activit
yThread.java:135)
E/AndroidRuntime( 1201):        at android.app.ActivityThread$H.handleMessage(Ac
tivityThread.java:1196)
E/AndroidRuntime( 1201):        at android.os.Handler.dispatchMessage(Handler.ja
va:102)
E/AndroidRuntime( 1201):        at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 1201):        at android.app.ActivityThread.main(ActivityThrea
d.java:5017)
E/AndroidRuntime( 1201):        at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 1201):        at java.lang.reflect.Method.invoke(Method.java:5
15)
E/AndroidRuntime( 1201):        at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 1201):        at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:595)
E/AndroidRuntime( 1201):        at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager(  370):   Force finishing activity com.davidobot.pixel/.PixelA
ctivity
E/gralloc_goldfish(   50): gralloc_alloc: Mismatched usage flags: 328 x 583, usa
ge 333
W/GraphicBufferAllocator(   50): alloc(328, 583, 1, 00000333, ...) failed -22 (I
nvalid argument)
E/        (   50): GraphicBufferAlloc::createGraphicBuffer(w=328, h=583) failed
(Invalid argument), handle=0x0
E/BufferQueue(  370): [ScreenshotClient] dequeueBuffer: SurfaceComposer::createG
raphicBuffer failed
W/WindowManager(  370): Screenshot failure taking screenshot for (328x583) to la
yer 21010
W/ActivityManager(  370): Activity pause timeout for ActivityRecord{b2610e90 u0
com.davidobot.pixel/.PixelActivity t5 f}
W/EGL_emulation(  740): eglSurfaceAttrib not implemented
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/Effect_Tick.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Eff
ect_Tick.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressStandard.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressStandard.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressSpacebar.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressSpacebar.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressDelete.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressDelete.ogg
E/SoundPool(  370): error loading /system/media/audio/ui/KeypressReturn.ogg
W/AudioService(  370): Soundpool could not load file: /system/media/audio/ui/Key
pressReturn.ogg
I/Process ( 1201): Sending signal. PID: 1201 SIG: 9
I/ActivityManager(  370): Process com.davidobot.pixel (pid 1201) has died.

Also, here is my AndroidManifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.davidobot.pixel"
      android:versionCode="10"
      android:versionName="0.9.0-beta1-jetpackpixel-v1.0"
      android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <!-- Allow writing to external storage -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="Jetpack Pixel v1.0"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <activity
            android:name="PixelActivity"
            android:configChanges="orientation|screenSize"
            android:label="Jetpack Pixel"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="tv.ouya.intent.category.GAME"/>
            </intent-filter>
        </activity>
    </application>

    <!-- Android 2.3.3 -->
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="18" />

    <!-- OpenGL ES 2.0 -->
    <uses-feature android:glEsVersion="0x00020000" /> 
</manifest> 

Comments (9)

  1. Jairo Luiz

    The APK won't run because the native libraries was not compiled.

    I see a "make.exe: *** Access is denied.". Maybe this's a clue to solve your problem.

  2. David Khachaturov reporter

    I tried running cmd as administrator, and I moved all the files from my desktop to C:/ndk-android-r9c

  3. Martin Felis repo owner

    Do you build it from Eclipse? There might be problems running multiple make jobs in parallel. In Properties->Builders->ndk-build remove the arguments "-j 4". This makes compilation slower but might help.

  4. David Khachaturov reporter

    No, I build it from command line. I tried running it with --jobs 5 and without it. Same result. I'll try to maybe reinstall the ndk.

  5. David Khachaturov reporter

    Tried re-installing, did nothing.

    Still don't understand why make.exe is denying permission.

  6. Log in to comment