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

Fix 2.0 builds on Windows #606

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 14 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 496 created by raziel23x on 2013-07-28T20:13:25.000Z:

What steps will reproduce the problem?

  1. git clone -b WIP-2.0 git://github.com/iBotPeaches/Apktool.git and git clone git://github.com/iBotPeaches/Apktool.git
  2. cd apktool
  3. gradlew.bat build fatJar proguard

What is the expected output? What do you see instead?
Successful build

What version of the product are you using? On what operating system?
Latest WIP-2.0 as well as latest master off github
WINDOWS 8 PRO with Media Center 64bit
LATEST 1.7 JAVA JDK

Please provide any additional information below.
Everything builds just find up until it gets to the test and that is where everything fails to build

it looks for the test here
C:\Users\Gerald\AppData\Local\Temp\BRUT5765124178345292726.tmp\testapp-new*

but the locations for the files that the FileNotFoundException points to is actually is at
C:\Users\Gerald\AppData\Local\Temp\BRUT5765124178345292726.tmp\testapp-orig*

no clue why it is looking for the location testapp-new when everything is at testapp-orig

I do not have this issue when I build with ubuntu 13.04 64bit
sll builds perfectly in linux

@iBotPeaches iBotPeaches self-assigned this Mar 18, 2015

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by connor.tumbleson on 2013-07-29T13:25:04.000Z:

08:21:56.890 [DEBUG] [TestEventLogger] Caused by:
08:21:56.893 [DEBUG] [TestEventLogger] java.nio.file.NoSuchFileException: /unk_folder/
08:21:56.897 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystem.checkParents(ZipFileSystem.java:856)
08:21:56.901 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystem.newOutputStream(ZipFileSystem.java:525)
08:21:56.904 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipPath.newOutputStream(ZipPath.java:792)
08:21:56.908 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream(ZipFileSystemProvider.java
08:21:56.912 [DEBUG] [TestEventLogger] at java.nio.file.Files.newOutputStream(Files.java:170)
08:21:56.915 [DEBUG] [TestEventLogger] at java.nio.file.Files.copy(Files.java:2832)
08:21:56.919 [DEBUG] [TestEventLogger] at java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:126)
08:21:56.923 [DEBUG] [TestEventLogger] at java.nio.file.Files.copy(Files.java:1228)
08:21:56.927 [DEBUG] [TestEventLogger] at brut.androlib.Androlib.insertFile(Androlib.java:588)
08:21:56.930 [DEBUG] [TestEventLogger] at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:565)
08:21:56.934 [DEBUG] [TestEventLogger] ... 37 more

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2013-07-29T13:25:04.000Z:

08:21:56.890 [DEBUG] [TestEventLogger] Caused by:
08:21:56.893 [DEBUG] [TestEventLogger] java.nio.file.NoSuchFileException: /unk_folder/
08:21:56.897 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystem.checkParents(ZipFileSystem.java:856)
08:21:56.901 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystem.newOutputStream(ZipFileSystem.java:525)
08:21:56.904 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipPath.newOutputStream(ZipPath.java:792)
08:21:56.908 [DEBUG] [TestEventLogger] at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream(ZipFileSystemProvider.java
08:21:56.912 [DEBUG] [TestEventLogger] at java.nio.file.Files.newOutputStream(Files.java:170)
08:21:56.915 [DEBUG] [TestEventLogger] at java.nio.file.Files.copy(Files.java:2832)
08:21:56.919 [DEBUG] [TestEventLogger] at java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:126)
08:21:56.923 [DEBUG] [TestEventLogger] at java.nio.file.Files.copy(Files.java:1228)
08:21:56.927 [DEBUG] [TestEventLogger] at brut.androlib.Androlib.insertFile(Androlib.java:588)
08:21:56.930 [DEBUG] [TestEventLogger] at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:565)
08:21:56.934 [DEBUG] [TestEventLogger] ... 37 more

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by raziel23x on 2013-07-30T01:50:41.000Z:

any ideas that might of caused this to only affect windows and to work just fine with ubuntu 13.04 and sun java 1.7_25 jdk

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by raziel23x on 2013-07-30T01:50:41.000Z:

any ideas that might of caused this to only affect windows and to work just fine with ubuntu 13.04 and sun java 1.7_25 jdk

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by raziel23x on 2013-08-14T18:32:32.000Z:

Since todays update it still fails to build on windows

org.jf.baksmali.AnalysisTest > DuplicateTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

6 tests completed, 1 failed
:brut.apktool.smali:baksmali:test FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':brut.apktool.smali:baksmali:test'.

    There were failing tests. See the report at: file:///D:/Github/Apktool/brut.apktool.smali/baksmali/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

Here is my test results

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by raziel23x on 2013-08-14T18:32:32.000Z:

Since todays update it still fails to build on windows

org.jf.baksmali.AnalysisTest > DuplicateTest FAILED
junit.framework.ComparisonFailure at AnalysisTest.java:107

6 tests completed, 1 failed
:brut.apktool.smali:baksmali:test FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':brut.apktool.smali:baksmali:test'.

    There were failing tests. See the report at: file:///D:/Github/Apktool/brut.apktool.smali/baksmali/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

Here is my test results

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by connor.tumbleson on 2013-08-14T22:12:34.000Z:

This is a separate problem. Smali2 can't be built via Windows: https://code.google.com/p/smali/issues/detail?id=177

Neither can Apktool, due to a separate bug. It however, doesn't affect the functionality, because the unit-tests separate of the build procedure all pass.

I still have to fix it, but its priority isn't as high, since nothing is actually broken except the build itself :p

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by connor.tumbleson on 2013-08-14T22:12:34.000Z:

This is a separate problem. Smali2 can't be built via Windows: https://code.google.com/p/smali/issues/detail?id=177

Neither can Apktool, due to a separate bug. It however, doesn't affect the functionality, because the unit-tests separate of the build procedure all pass.

I still have to fix it, but its priority isn't as high, since nothing is actually broken except the build itself :p

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by wirone on 2013-08-18T22:04:58.000Z:

I have the same problem with:
Execution failed for task ':brut.apktool.smali:baksmali:test'

I wanted to build ApkTool v2 for Ingress mod, but I can't. Can someone share built jar with me?

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by wirone on 2013-08-18T22:04:58.000Z:

I have the same problem with:
Execution failed for task ':brut.apktool.smali:baksmali:test'

I wanted to build ApkTool v2 for Ingress mod, but I can't. Can someone share built jar with me?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by connor.tumbleson on 2013-08-30T12:33:24.000Z:

Issue 508 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by connor.tumbleson on 2013-08-30T12:33:24.000Z:

Issue 508 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by connor.tumbleson on 2013-08-31T15:50:16.000Z:

Well finally tracked this down. It seems the java.nio.FileSystem doesn't write anything until .Close() is called, and there is no public method for sync(), flush(), etc.

So I can think of 3 options.

  1. Open/Close the FileSystem between each write, but because of this. Would need to update the Decoder to correctly write folders and files instead of just files. Probably could use folder name with storage number of "0", then check for "0" knowing it was a file.

  2. Drop java.nio.ZipSystem and go back to basically ZipFileStreams

  3. Use reflection, and make public sync() and call it in between operations to the ZipFile.

Either way, I found the problem and working on it.

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by connor.tumbleson on 2013-08-31T15:50:16.000Z:

Well finally tracked this down. It seems the java.nio.FileSystem doesn't write anything until .Close() is called, and there is no public method for sync(), flush(), etc.

So I can think of 3 options.

  1. Open/Close the FileSystem between each write, but because of this. Would need to update the Decoder to correctly write folders and files instead of just files. Probably could use folder name with storage number of "0", then check for "0" knowing it was a file.

  2. Drop java.nio.ZipSystem and go back to basically ZipFileStreams

  3. Use reflection, and make public sync() and call it in between operations to the ZipFile.

Either way, I found the problem and working on it.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by connor.tumbleson on 2013-09-07T13:55:15.000Z:

Fixed.

The problem with baksmali is still there, but that'll be fixed during smali2 gold.

054ddb1

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by connor.tumbleson on 2013-09-07T13:55:15.000Z:

Fixed.

The problem with baksmali is still there, but that'll be fixed during smali2 gold.

054ddb1

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by polaris.melody on 2013-10-15T02:10:27.000Z:

problem still exists: wip-2.0 branch

Exception in thread "main" brut.androlib.AndrolibException: java.nio.file.NoSuchFileException: /org/joda/time/tz/data/
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:570)
at brut.androlib.Androlib.build(Androlib.java:293)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:233)
at brut.apktool.Main.main(Main.java:88)
Caused by: java.nio.file.NoSuchFileException: /org/joda/time/tz/data/
at com.sun.nio.zipfs.ZipFileSystem.checkParents(ZipFileSystem.java:856)
at com.sun.nio.zipfs.ZipFileSystem.newOutputStream(ZipFileSystem.java:525)
at com.sun.nio.zipfs.ZipPath.newOutputStream(ZipPath.java:792)
at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream(ZipFileSystemProvider.java:285)
at java.nio.file.Files.newOutputStream(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at java.nio.file.CopyMoveHelper.copyToForeignTarget(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at brut.androlib.Androlib.insertFile(Androlib.java:590)
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:566)

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by polaris.melody on 2013-10-15T02:10:27.000Z:

problem still exists: wip-2.0 branch

Exception in thread "main" brut.androlib.AndrolibException: java.nio.file.NoSuchFileException: /org/joda/time/tz/data/
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:570)
at brut.androlib.Androlib.build(Androlib.java:293)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:233)
at brut.apktool.Main.main(Main.java:88)
Caused by: java.nio.file.NoSuchFileException: /org/joda/time/tz/data/
at com.sun.nio.zipfs.ZipFileSystem.checkParents(ZipFileSystem.java:856)
at com.sun.nio.zipfs.ZipFileSystem.newOutputStream(ZipFileSystem.java:525)
at com.sun.nio.zipfs.ZipPath.newOutputStream(ZipPath.java:792)
at com.sun.nio.zipfs.ZipFileSystemProvider.newOutputStream(ZipFileSystemProvider.java:285)
at java.nio.file.Files.newOutputStream(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at java.nio.file.CopyMoveHelper.copyToForeignTarget(Unknown Source)
at java.nio.file.Files.copy(Unknown Source)
at brut.androlib.Androlib.insertFile(Androlib.java:590)
at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:566)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by polaris.melody on 2013-10-15T02:30:34.000Z:

all files under directory /org/joda/time/tz/data/ have no suffix

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by polaris.melody on 2013-10-15T02:30:34.000Z:

all files under directory /org/joda/time/tz/data/ have no suffix

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by eyecatchup on 2013-11-17T16:16:05.000Z:

RE # 3: I had the exact same error message and was struggeling on this for hours now. Finally fixed this (and another) issue and successfully compiled the 2.0.0-b8 version on Windows 7. Can send a patch via Github if project maintainers want to have a look at it.

For now, here's the compiled jar (+ .bat + latest aapt.exe) as apktool-cli-2.0.0-Beta8-windows.zip http://d-h.st/MZG (due to file size limitations uploaded elsewhere).

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by eyecatchup on 2013-11-17T16:16:05.000Z:

RE # 3: I had the exact same error message and was struggeling on this for hours now. Finally fixed this (and another) issue and successfully compiled the 2.0.0-b8 version on Windows 7. Can send a patch via Github if project maintainers want to have a look at it.

For now, here's the compiled jar (+ .bat + latest aapt.exe) as apktool-cli-2.0.0-Beta8-windows.zip http://d-h.st/MZG (due to file size limitations uploaded elsewhere).

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by connor.tumbleson on 2013-11-17T16:25:06.000Z:

Okay, you fixed "this". Don't know what that is referring to as there was like 4 different bugs brought up in this report :p

Don't know what "another issue" means. Since we have like 60 outstanding issues. So if you want to make a patch, there is github or googlecode to make a request against, but please be descriptive if you do, because I'm lost as to what this is fixes.

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by connor.tumbleson on 2013-11-17T16:25:06.000Z:

Okay, you fixed "this". Don't know what that is referring to as there was like 4 different bugs brought up in this report :p

Don't know what "another issue" means. Since we have like 60 outstanding issues. So if you want to make a patch, there is github or googlecode to make a request against, but please be descriptive if you do, because I'm lost as to what this is fixes.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #13 originally posted by eyecatchup on 2013-11-17T16:31:56.000Z:

Change # 1: JesusFreke/smali@7a03efc

Change # 2: Apart from the newline issue, there's another issue here: https://github.com/iBotPeaches/Apktool/blob/wip-2.0/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java#L163

Because the path name lengths are limited in Windows, trying to create the direcory "values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key-navhidden-dpad" fails. In return the qualifiers test, and following the build fails again.

I just commented out the following lines in brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java

/*
@test
public void qualifiersTest() throws BrutException {
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
+ "-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key"
+ "-navhidden-dpad/strings.xml");
}
*/

Et voila. Compiles.. :)

Owner

iBotPeaches commented Mar 18, 2015

Comment #13 originally posted by eyecatchup on 2013-11-17T16:31:56.000Z:

Change # 1: JesusFreke/smali@7a03efc

Change # 2: Apart from the newline issue, there's another issue here: https://github.com/iBotPeaches/Apktool/blob/wip-2.0/brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java#L163

Because the path name lengths are limited in Windows, trying to create the direcory "values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key-navhidden-dpad" fails. In return the qualifiers test, and following the build fails again.

I just commented out the following lines in brut.apktool/apktool-lib/src/test/java/brut/androlib/BuildAndDecodeTest.java

/*
@test
public void qualifiersTest() throws BrutException {
compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
+ "-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key"
+ "-navhidden-dpad/strings.xml");
}
*/

Et voila. Compiles.. :)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #14 originally posted by eyecatchup on 2013-11-17T16:36:33.000Z:

More "elegant"

@Test
public void qualifiersTest() throws BrutException {
    if (!System.getProperty("os.name").toLowerCase().contains("windows")) {
        compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
                + "-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key"
                + "-navhidden-dpad/strings.xml");
    }
}
Owner

iBotPeaches commented Mar 18, 2015

Comment #14 originally posted by eyecatchup on 2013-11-17T16:36:33.000Z:

More "elegant"

@Test
public void qualifiersTest() throws BrutException {
    if (!System.getProperty("os.name").toLowerCase().contains("windows")) {
        compareValuesFiles("values-mcc004-mnc4-en-rUS-ldrtl-sw100dp-w200dp-h300dp"
                + "-xlarge-long-land-desk-night-xhdpi-finger-keyssoft-12key"
                + "-navhidden-dpad/strings.xml");
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment