0

After long hours, I finally compiled the Haxe code targeting android using FlashDevelop. I copied the bin folder, which contains the apk file to my phone, when I tap the apk file, the "Do you want to install this application?" shows, but if I tap install, nothing happen, if I tap cancel, the installation page will hide.

I tried it on Galaxy S3, android 4.1.2

Any idea?

here is the build log I got:

Building HelloWorld
haxelib run nme build "C:\Users\KETAB\test haxe with android\application.nmml" android
haxelib run hxcpp Build.xml haxe -Dandroid -Dcpp -Dhaxe_208 -Dhaxe_209 -Dhaxe_210 -Dnme -Dnme_install_tool -Dsys -Dtrue
Buildfile: C:\Users\KETAB\test haxe with android\bin\android\bin\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 21.0.1
 [checkenv] Installed at D:\C_Desktop\Development\Android SDK

-setup:
     [echo] Project Name: HelloWorld
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
     [echo] Resolving Build Target for HelloWorld...
[gettarget] Project Target:   Android 2.2
[gettarget] API level:        8
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for HelloWorld...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-pre-build:

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Found Deleted Target File
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
    [javac] Compiling 10 source files to C:\Users\KETAB\test haxe with android\bin\android\bin\bin\classes

-post-compile:

-obfuscate:

-dex:
      [dex] input: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\classes
      [dex] input: D:\C_Desktop\Development\Android SDK\tools\support\annotations.jar
      [dex] Using Pre-Dexed annotations-9b179f85f2e5e5c36108e0339b2e749b.jar <- D:\C_Desktop\Development\Android SDK\tools\support\annotations.jar
      [dex] Found Deleted Target File
      [dex] Converting compiled files and external libraries into C:\Users\KETAB\test haxe with android\bin\android\bin\bin\classes.dex...
       [dx] Merged dex A (25 defs/30.3KiB) with dex B (2 defs/1.1KiB). Result is 27 defs/36.0KiB. Took 0.0s

-crunch:
   [crunch] Crunching PNG Files in source dir: C:\Users\KETAB\test haxe with android\bin\android\bin\res
   [crunch] To destination dir: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res
   [crunch] Processing image to cache: C:\Users\KETAB\test haxe with android\bin\android\bin\res\drawable-hdpi\icon.png => C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-hdpi\icon.png
   [crunch]   (processed image to cache entry C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-hdpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: C:\Users\KETAB\test haxe with android\bin\android\bin\res\drawable-ldpi\icon.png => C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-ldpi\icon.png
   [crunch]   (processed image to cache entry C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-ldpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: C:\Users\KETAB\test haxe with android\bin\android\bin\res\drawable-mdpi\icon.png => C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-mdpi\icon.png
   [crunch]   (processed image to cache entry C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-mdpi\icon.png: 0% size of source)
   [crunch] Processing image to cache: C:\Users\KETAB\test haxe with android\bin\android\bin\res\drawable-xhdpi\icon.png => C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-xhdpi\icon.png
   [crunch]   (processed image to cache entry C:\Users\KETAB\test haxe with android\bin\android\bin\bin\res\drawable-xhdpi\icon.png: 0% size of source)
   [crunch] Crunched 4 PNG files to update cache

-package-resources:
     [aapt] Creating full resource package...
     [aapt] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.

-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating HelloWorld-debug-unaligned.apk and signing it with a debug key...

-post-package:

-do-debug:
 [zipalign] Running zip align on final apk...
     [echo] Debug Package: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\HelloWorld-debug.apk
[propertyfile] Creating new property file: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\build.prop
[propertyfile] Updating property file: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\build.prop
[propertyfile] Updating property file: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\build.prop
[propertyfile] Updating property file: C:\Users\KETAB\test haxe with android\bin\android\bin\bin\build.prop

-post-build:

debug:

BUILD SUCCESSFUL
Total time: 10 seconds
Build succeeded
Done(0)
simo
  • 23,342
  • 38
  • 121
  • 218
  • Check if you allowed to install applications of unknown origins, sometimes I forget it. – ƒernando Valle Jan 28 '13 at 09:54
  • Yes, I've checked this, its allowed – simo Jan 28 '13 at 09:59
  • Is strange, try to target to 4.1 instead 2.2 to test in your device. – ƒernando Valle Jan 28 '13 at 10:02
  • 2
    you may have a bit more information in the logcat output – bwt Jan 28 '13 at 10:05
  • where can I find the logcat output? – simo Jan 28 '13 at 10:34
  • from command line : `adb logcat`, eclipse : add the Logcat view (if it is not already there). By the way what happens if you install the application using adb ? – bwt Jan 28 '13 at 10:59
  • adb is not installed, what's the easy way to install it? – simo Jan 28 '13 at 11:40
  • it's a part of the SDK, located in /platform-tools/ dir. You have to install the "Android SDK Platform-tools" using the SDK manager – bwt Jan 28 '13 at 12:06
  • Yes, I found it, adb logcat will yield: * daemon not running. starting it now on port 5037 * * daemon started successfully * - waiting for device - so, what to do now? I am sorry as its my first android app – simo Jan 28 '13 at 12:22
  • I have enabled debug mode at my phone, but there are hundred of lines coming out into the command line window, I don't know whats the related info I am seeking there .. – simo Jan 28 '13 at 12:39
  • when logcat starts it spits the content of the device's buffer. Wait until it settle down, then open a second window, type 'adb install '. You may see an error message from the PackageManager. – bwt Jan 28 '13 at 12:56
  • so 'adb install ' will attempt to install the apk located at my phone? how will I set the path? is it supposed to be like '/storage/sdcard0/test_folder/my_application.apk' ? – simo Jan 28 '13 at 13:05
  • is a windows path, adb copy the file on the phone, then install it – bwt Jan 28 '13 at 13:39
  • Ok, I have installed it with adb, it says: D:\C_Desktop\Development\Android SDK\platform-tools>adb install "c:\bin\HelloWor ld-debug.apk" 5584 KB/s (1887237 bytes in 0.330s) pkg: /data/local/tmp/HelloWorld-debug.apk Success but, when I open in with the phone, it just displays a black screen, although when I target flash player, I can see a text box, what could be wrong? – simo Jan 28 '13 at 14:33
  • So, the problem is not related to the installation, the https://developer.android.com/reference/android/util/Log.html class may help you to debug your application (now that you have a working logcat). you should probably close this question, and ask a new one if it doesn't – bwt Jan 28 '13 at 14:48
  • Thanks very much, I deeply appreciate your time& support :-) – simo Jan 28 '13 at 14:50
  • 1
    You can also use NME's `trace()` method, which will go to logcat as well - no need to go into platform specific code for logging :) – T045T May 19 '13 at 09:49

0 Answers0