Can't build the apktool under Ubuntu 12.10 and Windows XP #506

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

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 395 created by aspack on 2013-01-17T14:32:58.000Z:

What steps will reproduce the problem?
gradlew build

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

Instead of

BUILD SUCCESSFUL

Total time: 31.719 secs

I get:


:brut.apktool:apktool-lib:test

brut.androlib.BuildAndDecodeTest > classMethod FAILED
brut.androlib.AndrolibException at BuildAndDecodeTest.java:48
Caused by: brut.androlib.AndrolibException at BuildAndDecodeTest.java:48
Caused by: brut.common.BrutException at BuildAndDecodeTest.java:48
Caused by: java.io.IOException at BuildAndDecodeTest.java:48
Caused by: java.io.IOException at BuildAndDecodeTest.java:48

1 test completed, 1 failed
:brut.apktool:apktool-lib:test FAILED

FAILURE: Build failed with an exception.

What version of the product are you using? On what operating system?
1.6.0_20 on Windows XP
1.6.0_38 on Ubuntu 12.10

@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-01-17T14:34:05.000Z:

I bet you don't have aapt in your path. Need full stacktrace / ran w/ error to now.

fyi, in newest source the command is ./gradlew fatJar (not build)

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2013-01-17T14:34:05.000Z:

I bet you don't have aapt in your path. Need full stacktrace / ran w/ error to now.

fyi, in newest source the command is ./gradlew fatJar (not build)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by aspack on 2013-01-17T14:36:40.000Z:

Damn, you're right! Sorry, close it immediatelly :) May be add a simple check if aapt is installed?

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by aspack on 2013-01-17T14:36:40.000Z:

Damn, you're right! Sorry, close it immediatelly :) May be add a simple check if aapt is installed?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by connor.tumbleson on 2013-01-17T14:58:35.000Z:

I wish it was that simple. The BuildInstructions say "aapt needed", so thats good for now.

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by connor.tumbleson on 2013-01-17T14:58:35.000Z:

I wish it was that simple. The BuildInstructions say "aapt needed", so thats good for now.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by aspack on 2013-01-17T15:47:12.000Z:

You're right. But the perfect solution would check if the aapt is available :)

private static boolean isAAPTInstalled(){
   try
   {            
        Process proc = Runtime.getRuntime().exec("aapt");
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
        String line = null;
        while ( (line = br.readLine()) != null){}
    return true;
    } catch (Exception t){
        return false;
    }
}    
Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by aspack on 2013-01-17T15:47:12.000Z:

You're right. But the perfect solution would check if the aapt is available :)

private static boolean isAAPTInstalled(){
   try
   {            
        Process proc = Runtime.getRuntime().exec("aapt");
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
        String line = null;
        while ( (line = br.readLine()) != null){}
    return true;
    } catch (Exception t){
        return false;
    }
}    
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by connor.tumbleson on 2013-01-17T16:01:33.000Z:

I could add a unit-test for it. Sure, why not.

Kudos :)

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by connor.tumbleson on 2013-01-17T16:01:33.000Z:

I could add a unit-test for it. Sure, why not.

Kudos :)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by aspack on 2013-01-17T16:03:53.000Z:

Thanks. It should stop new blind reporters!

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by aspack on 2013-01-17T16:03:53.000Z:

Thanks. It should stop new blind reporters!

@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-01-17T19:43:11.000Z:

This issue was closed by revision 0673c1e.

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by connor.tumbleson on 2013-01-17T19:43:11.000Z:

This issue was closed by revision 0673c1e.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by aspack on 2013-01-18T11:01:46.000Z:

Sorry, doesn't work because the encodeAndDecodeTest() starts in @BeforeClass method and fails before the aapt is checked. Attached the modified version, please check if it looks ok.

One more moment - wrong aapt version. How we can handle such case in tests?

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by aspack on 2013-01-18T11:01:46.000Z:

Sorry, doesn't work because the encodeAndDecodeTest() starts in @BeforeClass method and fails before the aapt is checked. Attached the modified version, please check if it looks ok.

One more moment - wrong aapt version. How we can handle such case in tests?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by connor.tumbleson on 2013-01-18T12:07:44.000Z:

Yeah dunno what I was thinking :)

the aapt version number is always 0.2, they never update it. So not much help for us.

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by connor.tumbleson on 2013-01-18T12:07:44.000Z:

Yeah dunno what I was thinking :)

the aapt version number is always 0.2, they never update it. So not much help for us.

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