Author Topic: Problem building from command line (Linux)  (Read 5703 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Problem building from command line (Linux)
« on: January 01, 2015, 04:46:12 PM »
Just realized I can no longer build from the command line.  ndk-build runs fine, but ant fails, with the following output:

Code: [Select]
Buildfile: /home/paul/workspace/mupen64plus-ae/mupen64plus-ae/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 24.0.2
 [checkenv] Installed at /home/paul/bin/android-sdk

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

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for Mupen64Plus...
[gettarget] Project Target:   Android 4.4.2
[gettarget] API level:        19
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /home/paul/workspace/mupen64plus-ae/mupen64plus-ae/bin/rsObj
    [mkdir] Created dir: /home/paul/workspace/mupen64plus-ae/mupen64plus-ae/bin/rsLibs
     [echo] ----------
     [echo] Resolving Dependencies for Mupen64Plus...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [aapt] /home/paul/workspace/mupen64plus-ae/mupen64plus-ae/bin/AndroidManifest.xml:21: error: No resource identifier found for attribute 'isGame' in package 'android'
     [aapt]

BUILD FAILED
/home/paul/bin/android-sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/paul/bin/android-sdk/tools/ant/build.xml:698: null returned: 1

Total time: 1 second

It appears to not understand the attribute "android:isGame" in the application tag.  Googling didn't bring up a lot of results.  Anyone else encounter this before?

One thing I do notice in the output that looks wrong, is that it indicates the target is API level 19, when it sould be 21.  The project.properties and manifest indicate 21, so not sure where the 19 came from.  Maybe figuring that out will fix the other problem..
« Last Edit: January 01, 2015, 05:11:54 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Problem building from command line (Linux)
« Reply #1 on: January 01, 2015, 04:54:51 PM »
isGame is for google tv IIRC.  Do you have all the latest build tools, SDK, NDK?

Also - why is it targeting API 19 in the log?  We're at 21 now.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #2 on: January 01, 2015, 04:56:23 PM »
Updating them now.  That is probably it if isGame is relatively new.  Think its been a few weeks since I updated.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #3 on: January 01, 2015, 05:14:22 PM »
Darn, updating didn't help.  Updated the output in the OP so it shows the current versions.

I think it has something to do with the fact that it starts out saying it is targeting API level 19 instead of 21.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Problem building from command line (Linux)
« Reply #4 on: January 01, 2015, 05:21:02 PM »
Target 21. It will still work on lower versions, and will let you access API21's new features. I had that issue myself when using appcompat-v7

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #5 on: January 01, 2015, 05:29:41 PM »
That's what I mean.  According to project.properties and the manifest, it should be targeting 21.  Not sure why the output says 19.   :o
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Problem building from command line (Linux)
« Reply #6 on: January 01, 2015, 05:36:08 PM »
All I can say is grep the files for "19", and does ant have an equivalent of make clean?

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #7 on: January 01, 2015, 05:39:30 PM »
Will do.  Yes, it has ant clean, but didn't help   :-\
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #8 on: January 01, 2015, 05:41:39 PM »
gep worked.  ant.properties (duh.. should have checked that one)
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Problem building from command line (Linux)
« Reply #9 on: January 09, 2015, 02:48:13 PM »
@Paul - How hard would it be to auto-build other branches besides master?  I wanted to create some comparison builds that don't belong in master.  If you didn't want to build every branch, we could stick to a convention of auto-building only master and anything starting with "test-".
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #10 on: January 09, 2015, 03:16:45 PM »
I'll get it to build all branches tomorrow.  Shouldn't be too difficult, just need to loop through them and check if there are changes.  I kind of set the script up anticipating that I would be adding the loop, so won't take too much.  Main corner case to handle will be to check for new branches too, not just changes on existing branches, and also not crap out if there are deleted branches.
« Last Edit: January 09, 2015, 03:18:18 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #11 on: January 10, 2015, 12:39:37 PM »
It appears to be working.  The 2.x-bugfixes branch didn't get uploaded because there was a build error.  This was actually a good test of the script to demonstrate a case where a branch doesn't build.. it is able to continue on and build the other branches. 

Here is the interesting section of the log output from the auto-build script, where the build failed, then it switched to master, found no updates and skipped, then switched to a new branch and started building it:

Code: [Select]
...

-compile:
    [javac] Compiling 61 source files to /home/paul/auto-build/mupen64plus-ae/bin/classes
    [javac] /home/paul/auto-build/mupen64plus-ae/src/paulscode/android/mupen64plusae/persistent/AppData.java:104: error: cannot find symbol
    [javac]     public static final boolean IS_LOLLIPOP = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
    [javac]                                                                                           ^
    [javac]   symbol:   variable LOLLIPOP
    [javac]   location: class VERSION_CODES
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 error
Error: Build failed
Checking out branch 'master'
Your branch is up-to-date with 'origin/master'.
Executing git pull
Already up-to-date.
Nothing new to build
Checking out branch 'test-glide-always-draw-vbo'
Branch test-glide-always-draw-vbo set up to track remote branch test-glide-always-draw-vbo from origin.
New branch
Executing git pull
Cleaning previous build
Buildfile: /home/paul/auto-build/mupen64plus-ae/build.xml

...
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Problem building from command line (Linux)
« Reply #12 on: January 10, 2015, 02:25:42 PM »
Not sure about the build error, but just a few other comments:
 - Probably git fetch --prune --all on line 19 to remove deleted branches (I didn't intend for test-glide-always-draw-vbo to be built)
 - I think replace git pull on line 43 with git reset --hard origin/$currentBranch in case the branch was rewritten
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3499
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Problem building from command line (Linux)
« Reply #13 on: January 10, 2015, 06:24:28 PM »
Good point about the branch being rewritten.  I changed git pull to git rest --hard.

Interesting that --prune is necessary.  I had assumed "git branch -r" would only return remote branches, but guess it doesn't do anything about deleted branches.  I'm pretty sure I never checked out test-glide-always-draw-vbo from the clone I'm using for auto-build.. so not sure how it entered the picture (maybe a side effect of a previous "git pull" when that branch existed on the remote repository?)  Git is confusing sometimes...  Anyway, --prune does the trick.  Thanks for the tip.

EDIT: Actually, now that I think about it, branch probably was there when I cloned the repository..  That would make more sense.
« Last Edit: January 10, 2015, 06:31:01 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Problem building from command line (Linux)
« Reply #14 on: January 10, 2015, 07:10:21 PM »
It took me a while to realize it, but there are three branches of interest, not two, when you clone a repo.
 - The remote branch (lives on github)
 - The remote-tracking branch (mirrors the remote branch as of last fetch, lives on your machine)
 - The local branch (lives on your machine, is independent of remote-tracking branch)

As a safety measure, git doesn't delete the remote-tracking branch on your local machine when the remote branch is deleted.  You have to intentionally delete it with git fetch --prune.  There's a git config flag you can set if you want to prune by default: http://stackoverflow.com/questions/18308535/automatic-prune-with-git-fetch-or-pull

git fetch --all is what created the remote-tracking branch (origin/test-glide-...) on your cron machine.  That branch existed temporarily on github until I decided to delete it.

2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version