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

Unable to build on Windows #312

Closed
xmenxwk opened this issue Jan 24, 2015 · 24 comments
Closed

Unable to build on Windows #312

xmenxwk opened this issue Jan 24, 2015 · 24 comments

Comments

@xmenxwk
Copy link

xmenxwk commented Jan 24, 2015

I've tryiing to build its sample app for 2 hours but everywhere errors and errors. Its not straight forward as written in description. Would you you please fix it ?

Im using android studio and trying to checkout using https url. Before I tried with github terminal, but no success.

@TWiStErRob
Copy link
Collaborator

Did you do the submodule part? Try to make it work in terminal first and then import to AS.

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

Could you please write in steps ?

Im using Windows 7

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

This is the error Im getting when I use "gradlew jar" in cmd

FAILURE: Build failed with an exception.

  • What went wrong:
    Failed to capture snapshot of input files for task 'findbugs' during up-to-date
    check. See stacktrace for details.

    Could not normalize path for file 'D:\glide\third_party\gif_decoder\build\outp
    uts\aar\gif_decoder-release.aar;D:\glide\third_party\gif_encoder\build\outputs\a
    ar\gif_encoder-release.aar;D:\glide\third_party\disklrucache\build\libs\disklruc
    ache.jar;C:\android-sdk\extras\android\m2repository\com\android\support\support-
    v4\19.1.0\support-v4-19.1.0.jar'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

@TWiStErRob
Copy link
Collaborator

I managed to build on Windows 7 when I did it using
https://github.com/bumptech/glide/blob/master/README.md#build
and I think I used JDK 6, and latest Android SDK.

@TWiStErRob
Copy link
Collaborator

Ahh that thing, I fixed that, but it didn't make it to master. Let me dig it up.

@TWiStErRob
Copy link
Collaborator

library/build.gradle from #272

@TWiStErRob
Copy link
Collaborator

As an alternative you can temporarily skip a task, but that doesn't help if you want to import it into AS.

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

it started downloading more files then this

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':library:findbugs'.

    The version of FindBugs (2.0.3) inferred from FindBugs classpath is too low to
    work with currently used Java version (1.8). Please use higher version of FindB
    ugs. Inspected FindBugs classpath: [findbugs-2.0.3.jar, jcip-annotations-1.0.jar
    , jsr305-2.0.1.jar, bcel-2.0.1.jar, jFormatString-2.0.1.jar, dom4j-1.6.1.jar, as
    m-3.3.jar, asm-commons-3.3.jar, commons-lang-2.6.jar, AppleJavaExtensions-1.4.ja
    r, jaxen-1.1.6.jar, xml-apis-1.0.b2.jar, asm-tree-3.3.jar]

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

is java 1.8 not supported ?

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

Nevermind, I changed the JAVA_HOME and JDK_HOME to java 1.7 and its now keep going.

@TWiStErRob
Copy link
Collaborator

Android supports Java 7 since 4.4, but Glide builds with Java 6 to be compatible with most Android builds. Use JDK 6. FindBugs must have their own reasons why it is not forward compatible.

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

now new error

com.bumptech.glide.disklrucache.DiskLruCacheTest > aggressiveClearingHandlesEdit FAILED
    java.io.IOException at DiskLruCacheTest.java:734

com.bumptech.glide.disklrucache.DiskLruCacheTest > aggressiveClearingHandlesRead FAILED
    java.io.IOException at DiskLruCacheTest.java:759

com.bumptech.glide.disklrucache.DiskLruCacheTest > updateExistingEntryWithTooFewValuesReusesPreviousValues FAILED
    org.junit.ComparisonFailure at DiskLruCacheTest.java:346

com.bumptech.glide.disklrucache.DiskLruCacheTest > editSnapshotAfterChangeAborted FAILED
    org.junit.ComparisonFailure at DiskLruCacheTest.java:903

com.bumptech.glide.disklrucache.DiskLruCacheTest > evictOnUpdate FAILED
    org.junit.ComparisonFailure at DiskLruCacheTest.java:422

com.bumptech.glide.disklrucache.DiskLruCacheTest > aggressiveClearingHandlesWrite FAILED
    java.io.IOException at DiskLruCacheTest.java:725

com.bumptech.glide.disklrucache.DiskLruCacheTest > editSameVersion FAILED
    org.junit.ComparisonFailure at DiskLruCacheTest.java:903

com.bumptech.glide.disklrucache.DiskLruCacheTest > aggressiveClearingHandlesPartialEdit FAILED
    java.io.IOException at DiskLruCacheTest.java:751

56 tests completed, 8 failed
:third_party:disklrucache:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':third_party:disklrucache:test'.
> There were failing tests. See the report at: file:///D:/glide/third_party/disk
lrucache/build/reports/tests/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 20 mins 22.199 secs

@sjudd sjudd changed the title Unable to build Unable to build on Windows Jan 24, 2015
@sjudd
Copy link
Collaborator

sjudd commented Jan 24, 2015

I'd recommend considering VirtualBox + Linux. Since travis-ci only supports Linux, Linux is the only officially supported platform. I develop regularly on OSX, so that's likely to work.

I don't object to supporting Windows, but until we have some CI setup for it it's likely to continue to btrsk. I wouldn't object to a pull request adding ci support for windows. AppVeyor might be a possibility.

@TWiStErRob
Copy link
Collaborator

Rename DiskLruCacheTest.java to have a different extension.
disklrucache was written for Android/unix and the Windows file system has different quirks so it won't run because the tests assume unix-like file system behaviour, see JakeWharton/DiskLruCache#70 (comment)

@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

@sjudd : Yes I will be using linux soon, but right now I need this on Windows.

@TWiStErRob : renamed, same error. Is there any parameter to skip the tests ?

@TWiStErRob
Copy link
Collaborator

Try a clean build, the .class file probably stuck. Thinking twice it's best to remove the test file, not just rename.
To skip: as referenced above something like: -x :third_party:disklrucache:testBlah would help. Check the last task name above the failure.

@xmenxwk xmenxwk closed this as completed Jan 24, 2015
@xmenxwk
Copy link
Author

xmenxwk commented Jan 24, 2015

Thank you very much, @TWiStErRob :)

@sjudd
Copy link
Collaborator

sjudd commented Jan 24, 2015

Since we haven't checked anything in to fix this and someone else may find it useful, let's leave this open for now.

@TWiStErRob
Copy link
Collaborator

There's a failure in library/build.gradle where files can't handle multiple jars in asPath. Since FindBugs.classpath is a FileCollection and Configuration extends FileCollection the following works: replace
classpath = files(project.configurations.compile.asPath)
with
classpath = project.configurations.compile

@TWiStErRob
Copy link
Collaborator

DiskLruCacheTest fails at least 8 test methods, so I think it's easier to disable all:

@BeforeClass public static void setUpClass() {
    Assume.assumeThat(System.getProperty("os.name"),
            IsNot.not(StringStartsWith.startsWith("Windows")));
}

This would still allow Travis to catch bugs, but also allow people on Windows to build.

sjudd added a commit to sjudd/glide that referenced this issue Apr 30, 2015
sjudd added a commit to sjudd/glide that referenced this issue Apr 30, 2015
@TWiStErRob
Copy link
Collaborator

@sjudd this can be closed now, thank you for putting the fixes in.
It builds flawlessly without any hacks. The key is to use the correct java version.

(DiskLruCache commit for reference: sjudd/DiskLruCache@cd49c1d)

@sjudd
Copy link
Collaborator

sjudd commented Apr 30, 2015

Great, glad to hear it.

@sjudd sjudd closed this as completed Apr 30, 2015
@TWiStErRob
Copy link
Collaborator

Dang, I missed one, I had it in local changes:
disklrucache/checkstyle.xml:

    <module name="NewlineAtEndOfFile">
        <property name="lineSeparator" value="lf" />
    </module>

@sjudd sjudd added this to the 3.6.0 milestone May 1, 2015
@sjudd sjudd reopened this May 1, 2015
@sjudd
Copy link
Collaborator

sjudd commented May 2, 2015

Should be fixed here: ae4a451

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

No branches or pull requests

3 participants