Gradle configuration: Android Studio only builds when run from command line

RESOLVED WORKSFORME

Status

()

Firefox for Android
Build Config & IDE Support
RESOLVED WORKSFORME
4 years ago
7 months ago

People

(Reporter: garvan, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Here is the build error:
https://pastebin.mozilla.org/7289934

Here is the gradle properties file
gkeeley13311:obj-fennec gkeeley$ more mobile/android/gradle/gradle.properties
topsrcdir=/Users/gkeeley/c/src2/mozilla-central
topobjdir=/Users/gkeeley/c/src2/obj-fennec
compileSdkVersion=android-20
buildToolsVersion=20.0.0
targetSdkVersion=20
minSdkVersion=9
MOZ_CRASHREPORTER=false

Background: OS X 10.9, Android Studio 0.8.14

I imported the project by selecting the 'gradle' item:
https://www.dropbox.com/s/8tw5ybk3xw1zv81/Screenshot%202014-11-13%2013.02.49.png
Created attachment 8522364 [details] [diff] [review]
Don't use -C argument when building gradle-targets.

We run mach in the object directory, but it appears that the -C argument
fouls the object directory discovery.  This avoids that issue.

garvank: apply this patch, build from the command line, and then build
from the IDE?
Attachment #8522364 - Flags: feedback?(gkeeley)
(Reporter)

Comment 2

4 years ago
:base:prepareObjDir
Error running mach:
    ['build', 'mobile/android/base/gradle-targets']

If it is helpful, a successful run looks like this:
:base:prepareObjDir
 0:00.40 /opt/local/bin/gmake -C /Users/gkeeley/c/src2/obj-fennec -j8 -s backend.RecursiveMakeBackend
 0:03.58 /opt/local/bin/gmake -C mobile/android/base -j8 -s gradle-targets
 0:03.61 omni.ja
(Reporter)

Updated

4 years ago
Attachment #8522364 - Flags: feedback?(gkeeley) → feedback-
(Reporter)

Comment 3

4 years ago
With this patch, starting from the command-line and building still works.
(Reporter)

Comment 4

4 years ago
> garvank: apply this patch, build from the command line, and then build
> from the IDE?

ASIDE: The build from command-line step seems redundant, the IDE is going to do the same thing.
(Reporter)

Comment 5

4 years ago
In AS, Project Settings > Compiler > Command-line options
Added |--stacktrace --debug|

Lots of output
https://pastebin.mozilla.org/7292189
(Reporter)

Comment 6

4 years ago
Created attachment 8522492 [details]
AS debug gradle log

the paste bin is truncated, here is the full log
(Reporter)

Comment 7

4 years ago
Nick you were right, the OBJDIR has no effect. Simply running AS from the command-line is enough.
Summary: Gradle configuration: Android Studio only picks up $OBJDIR when run from command line → Gradle configuration: Android Studio only builds when run from command line
Blocks: 1041395
I think this is no longer an issue. garvank, can you re-open if appropriate?
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(gkeeley)
Resolution: --- → WORKSFORME
(Reporter)

Comment 9

3 years ago
Correct, I have multiple build environments, configured by my shell, and the environment for Finder-level apps uses an environment that is for another project. Essentially this is a byproduct of my particular setup.
Flags: needinfo?(gkeeley)
Component: Build Config → Build Config & IDE Support
Product: Core → Firefox for Android
You need to log in before you can comment on or make changes to this bug.