Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues when trying Android #1

Open
hoseyjoe opened this issue Nov 2, 2018 · 3 comments
Open

issues when trying Android #1

hoseyjoe opened this issue Nov 2, 2018 · 3 comments

Comments

@hoseyjoe
Copy link

hoseyjoe commented Nov 2, 2018

  1. I added -lib haxeui-android to hxml and get error.
    haxe/ui/backend/android/behaviours/CompoundButtonChecked.hx:3: charactersacters 8-37 : Type not found : android.widget.CompoundButton

  2. Also cli\templates\android-shared\local.properties doesn't exist in haxe-core new-component-branch. So I placed a blank file called local.properties to get past

  3. TextInputBase didnt have 2 functions
    public function focus(){ }
    public function blur(){ }

  4. Finally failed at
    Starting a Gradle Daemon (subsequent builds will be faster)
    File not found - *.xml
    Could Not Find ...\build\android\app\src\main\java*.xml
    -copied AndroidManaifest.xml up 1 folder into java folder every build and got
    FAILURE: Build failed with an exception.

  • Changed gradle.properties to be org.gradle.jvmargs=-Xmx512m
  1. gave up at
    :app:compileDebugJavaWithJavac FAILED
    15 actionable tasks: 1 executed, 14 up-to-date

The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at java.lang.Character.digit(Character.java:6563)
at java.lang.Character.digit(Character.java:6511)
at com.sun.tools.javac.parser.UnicodeReader.digit(UnicodeReader.java:225)
at com.sun.tools.javac.parser.JavaTokenizer.scanDigits(JavaTokenizer.java:206)
at com.sun.tools.javac.parser.JavaTokenizer.scanNumber(JavaTokenizer.java:322)
at com.sun.tools.javac.parser.JavaTokenizer.readToken(JavaTokenizer.java:538)
at com.sun.tools.javac.parser.Scanner.nextToken(Scanner.java:115)

@hoseyjoe hoseyjoe changed the title Attaching lib to project throws Type Not found issues when trying Android Nov 2, 2018
@ianharrigan
Copy link
Member

The android build its a lot more complex / involved... you need to create a gradle project essentially - there isnt a command line tool to do this that comes with the android SDK (there used to be when it was ant based). So haxeui comes with a tool that does it for you. So copying the templates is kind of what the tool does, but it actually does more like replacing certain things inside the output. My advice would be to use:

haxelib run haxeui-core create android in a blank folder - if the folder already has contents it may (incorrectly) create another Main.hx - ill have a check to see how "clever" it is at detecting that stuff.

Ian

PS: the focus / blur stuff should be fixed now

@ianharrigan
Copy link
Member

ianharrigan commented Nov 3, 2018

heres an example .hxml that is outputted by the haxeui tool, fyi:

-cp src

-main Main

-dce no
-D no-compilation

-lib haxeui-core
-lib haxeui-android
-lib hscript

-java-lib X:\AndroidSDK\platforms\android-21\android.jar

-java build/android/app/src/main/java

-cmd cd build/android
# so this is annoying - hxJava seems to always add "src/" infront of path names
# and thus this is windows specific
-cmd xcopy app\src\main\java\src app\src\main\java /s /e /y
-cmd del app\src\main\java\src\* /q /s
-cmd rmdir app\src\main\java\src /q /s

# this is annoying too - android resources seem to need to be in an assets/ dir, copy them
# css
-cmd xcopy app\src\main\java\*.css app\src\main\assets /s /y /i
-cmd del app\src\main\java\*.css /q /s
# xml
-cmd xcopy app\src\main\java\*.xml app\src\main\assets /s /y /i
-cmd del app\src\main\java\*.xml /q /s
# png
-cmd xcopy app\src\main\java\*.png app\src\main\assets /s /y /i
-cmd del app\src\main\java\*.png /q /s

-cmd gradlew build -x lint

Note that you will need an ANDROID_HOME env var setup (which i think should already setup as part of the SDK)

Finally, to run the .apk, you can use:

call haxelib run haxeui-core run android
call %ANDROID_HOME%/platform-tools/adb logcat System.out:I *:S

@hoseyjoe
Copy link
Author

hoseyjoe commented Nov 6, 2018

Android.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants