Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Android compiling - Cygwin error

Author
Message
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 8th Feb 2012 23:41
So I've tried to compile my first Android-game.
I followed the steps provided by AppGameKit, without any hick-ups, until I reached the Cygwin-section.

I've tried the steps with both the r6b and r7-version of the Android NDK, but neither worked.

I used this command: "/cygdrive/c/AndroidDev/android-ndk-r6b/ndk-build> log.txt"

Am I doing anything wrong?
Is there a better guide for amateurs like myself out at this time?

Thanks for any help what so ever

I dont have a signature...
kdf
17
Years of Service
User Offline
Joined: 31st May 2006
Playing:
Posted: 9th Feb 2012 09:41 Edited at: 9th Feb 2012 09:55
Take a look at this thread
http://forum.thegamecreators.com/?m=forum_view&t=191875&b=46

It has a lot of issues resolved

Make sure firstly that you have the updated cygwin 1.7 version and also the gnu make tool installed.
Also, when compiling under cygwin note that paths and file names are case sensitive.

It is always useful if you attach the make output in the file log.txt which is in you interpreter_android folder, so we can see the errors.

Make sure you have a minimum Win XP WITH Service Pack 3.
Also allow 'Full Control' to all users on a Win 7 machine or 'make' will throw a 'permission denied' exception when trying to compile libAGKAndroid.a
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 9th Feb 2012 22:05
Yeah, but it seems that they don't have the same problem as me.

I get an error saying that the command don't exist.

Trond@TrondTouchsmart /cygdrive/c/AndroidDev/IDE/apps/interpreter_android
$ C:\AndroidDev\android-ndk-r6b\ndk-build>log2.txt
-bash: C:AndroidDevandroid-ndk-r6bndk-build: command not found

I dont have a signature...
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Feb 2012 17:41
In "/cygdrive/c/AndroidDev/android-ndk-r6b/ndk-build> log.txt" it doesn't look like there is a space in front of the >, there needs to be.
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 10th Feb 2012 18:00
Yeah I figured it out. Apperantly, something went wrong when I installed the "MAKE" thingy.

But, according to chaos-theory, something else went wrong soon after my little breakthrough.

I compiled the file with Cygwin, as the guide states.
The Log.txt-file contained this:

#########################################################
Compile arm : android_player <= main.c

Compile++ arm : android_player <= Core.cpp

Compile++ arm : android_player <= interpreter.cpp

Prebuilt : libAGKAndroid.a <= jni/armeabi/

Compile thumb : android_native_app_glue <= android_native_app_glue.c

StaticLibrary : libandroid_native_app_glue.a

StaticLibrary : libstdc++.a

SharedLibrary : libandroid_player.so

/cygdrive/c/AndroidDev/android-ndk-r7/build/core/build-binary.mk:312: recipe for target `obj/local/armeabi/libandroid_player.so' failed
##########################################################

I ignored this thinking it was og no importance.
I loaded the file into the Eclipse environment, just as the guide said, but when it had finished loading, I got four errors and no code-files(not anyone I could find, anyway).

Here is the errors:

##########################################################
1) The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project AGKPlayer Unknown Java Problem

2) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Dummy.java /AGKPlayer/src line 1 Java Problem

3) Unable to resolve target 'android-9' AGKPlayer Unknown Android Target Problem

4) Unable to resolve target 'android-9' until the SDK is loaded. AGKPlayer Unknown Android Target Problem
##########################################################

I am lost.
Also, pardon my English, it's not my first language.

I dont have a signature...
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 11th Feb 2012 17:43
Ok I made som new progress. (Btw, I keep writing this post so that others may see what I did wrong and how I fixed it)

I figured out my last issue, and fixed it simply by installing the Android SDK 2.3.1 package(obviosly I had forgotten to do so earlier).

I tried to debug the application in an emulator, but it crashed "unexpectedly".

I retrieved the log.txt from Eclipse, and this is what I got:

###########################################################
02-11 16:40:03.081: D/AndroidRuntime(411): Shutting down VM
02-11 16:40:03.081: W/dalvikvm(411): threadid=1: thread exiting with uncaught exception (group=0x40015560)
02-11 16:40:03.101: E/AndroidRuntime(411): FATAL EXCEPTION: main
02-11 16:40:03.101: E/AndroidRuntime(411): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thegamecreators.agk_player/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to find native library: android_player
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.os.Handler.dispatchMessage(Handler.java:99)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.os.Looper.loop(Looper.java:123)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread.main(ActivityThread.java:3647)
02-11 16:40:03.101: E/AndroidRuntime(411): at java.lang.reflect.Method.invokeNative(Native Method)
02-11 16:40:03.101: E/AndroidRuntime(411): at java.lang.reflect.Method.invoke(Method.java:507)
02-11 16:40:03.101: E/AndroidRuntime(411): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-11 16:40:03.101: E/AndroidRuntime(411): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-11 16:40:03.101: E/AndroidRuntime(411): at dalvik.system.NativeStart.main(Native Method)
02-11 16:40:03.101: E/AndroidRuntime(411): Caused by: java.lang.IllegalArgumentException: Unable to find native library: android_player
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.NativeActivity.onCreate(NativeActivity.java:187)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-11 16:40:03.101: E/AndroidRuntime(411): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
02-11 16:40:03.101: E/AndroidRuntime(411): ... 11 more
###########################################################

I dont have a signature...
kdf
17
Years of Service
User Offline
Joined: 31st May 2006
Playing:
Posted: 11th Feb 2012 19:10
Make sure you have Java jdk 1.6 or above. Android has issues with jdk 1.5 when you decorate a method with @Override which is not a superclass method.

Also check that the 'CLASSPATH' System Variable is set to point to the jdk 1.6
Right Click 'MyComputer'
Advanced -> Environment Variables
Under the System Variables window edit the CLASSPATH variable and insert the path to the jdk
C:\Program Files\Java\jdk1.6.0_20
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 11th Feb 2012 21:20
Yeah I tried to re-install the Java JDK in order to be sure I've got the right version, but it didn't really help. The AppGameKit Player in Eclipse keep crashing.

AGK should really consider one-button-deployment(if it's even possible) inside the AppGameKit IDE.

I dont have a signature...
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Feb 2012 19:40
The line



means it is not finding the lib "libandroid_player.so" that was compiled by cygwin, either it was not named "android_player" in the Android.mk file or it was not uploaded to the device. Make sure the AndroidManifest.xml file has the entry hasCode="true" in it to make sure it is uploaded.
MegaTronD
12
Years of Service
User Offline
Joined: 8th Feb 2012
Location:
Posted: 14th Feb 2012 20:28
I figured it out!
Apparantly, the build path were somewhat messed up.

Solution:
1) Right-click on the AGP Player-project and choose "Build Path > Configure Build Path"

2) Choose tab "Libraries"

3) Open Android 2.3.1 and select "Native Library Location"

4) Click edit and browse to the "android-sdk" folder.

Problem solved.

Btw, great forum! Thanks for all the help, everyone.
Great to see developers being active in here.

I dont have a signature...
victordavion
12
Years of Service
User Offline
Joined: 3rd Jan 2012
Location:
Posted: 9th Mar 2012 22:51 Edited at: 11th Mar 2012 04:34
I've given "Full Control" (in Win 7) to my dev directories so there shouldn't be any permission issues. I'm using a 'from scratch' project for the interpreter_android. I've followed the AppGameKit Documentation verbatim. I don't know what's wrong. I've exhausted my troubleshooting skills for today (4 hours on this one problem). Anyone have any ideas?

To be more specific I'm still stuck with having this error when compiling the library.


/cygdrive/c/Development/androidndk/android-ndk-r7b/build/core/build-binary.mk:314: recipe for target `obj/local/armeabi/libandroid_player.so' failed

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-18 18:42:57
Your offset time is: 2024-04-18 18:42:57