Recompilation ERROR: Asset package include '.\1.apk' not found. #1224

Closed
kondlada opened this Issue Apr 15, 2016 · 14 comments

Comments

Projects
None yet
4 participants
@kondlada

kondlada commented Apr 15, 2016

Information

  1. Apktool Version (apktool -version) - 2.1
  2. Operating System (Mac, Linux, Windows) - windows 7
  3. APK From? (Playstore, ROM, Other) -other

Stacktrace/Logcat

C:\Users\KH1148\Desktop\Newfolder>apktool d -f -s -p . -a ./aapt.exe SQLiteEditor.apk
I: Using Apktool 2.1.0 on SQLiteEditor.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: .\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying raw classes.dex file...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

C:\Users\KH1148\Desktop\Newfolder>apktool b -f -s -p . -a .\aapt.exe SQLiteEditor sql2.apk
I: Using Apktool 2.1.0
I: Copying SQLiteEditor classes.dex file...
I: Building resources...
W: ERROR: Asset package include '.\1.apk' not found.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1)
: [.\aapt.exe, p, --min-sdk-version, 2, --target-sdk-version, 9, --version-code, 10, --version-name, 1.5, -F, C:\Users\KH1148\AppData\Local\Temp\APKTO
OL465539216332545287.tmp, -0, arsc, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\SQLiteEditor\res, -M, C:\Users\KH1148\Desktop\Newfold
er\SQLiteEditor\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:433)
        at brut.androlib.Androlib.buildResources(Androlib.java:371)
        at brut.androlib.Androlib.build(Androlib.java:281)
        at brut.androlib.Androlib.build(Androlib.java:254)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [.\aapt.exe, p, --min-sdk-version, 2, --target-
sdk-version, 9, --version-code, 10, --version-name, 1.5, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL465539216332545287.tmp, -0, arsc, -0, arsc, -I,
 .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\SQLiteEditor\res, -M, C:\Users\KH1148\Desktop\Newfolder\SQLiteEditor\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:419)
        ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [.\aapt.exe, p, --min-sdk-version, 2, --target-sdk-version, 9, --version-code, 1
0, --version-name, 1.5, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL465539216332545287.tmp, -0, arsc, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Des
ktop\Newfolder\SQLiteEditor\res, -M, C:\Users\KH1148\Desktop\Newfolder\SQLiteEditor\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:95)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:427)
        ... 6 more

Steps to Reproduce

  1. apktool
    I have used following commands
    apktool d -f -s --frame-path . -a \aapt.exe Test.apk

apktool b -f -s --frame-path . -a \aapt.exe Test Test1.apk

it is failing in recompiling. I am not seeing apktoolXXXX.tmp file in temp folder.
SQLiteEditor.zip

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)

APK

If this APK can be freely shared, please upload/attach a link to it.

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?yes and it worked
  2. If you are trying to install a modified apk, did you resign it?
  3. Are you using the latest apktool version?yes
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 16, 2016

Owner
W: ERROR: Asset package include '.\1.apk' not found.

Custom built application have a constraint where all framework files must have an AndroidManifest.xml in them. You can add a bogus AndroidManifest.xml to each framework apktool generates in $HOME/apktool/framework/ when using custom aapt binaries.

A possible feature enhancement to automate the creation of this bogus AndroidManifest.xml file might be implemented to allow easier use of official aapt binaries.

Owner

iBotPeaches commented Apr 16, 2016

W: ERROR: Asset package include '.\1.apk' not found.

Custom built application have a constraint where all framework files must have an AndroidManifest.xml in them. You can add a bogus AndroidManifest.xml to each framework apktool generates in $HOME/apktool/framework/ when using custom aapt binaries.

A possible feature enhancement to automate the creation of this bogus AndroidManifest.xml file might be implemented to allow easier use of official aapt binaries.

@iBotPeaches iBotPeaches added the Feature label Apr 16, 2016

@kondlada

This comment has been minimized.

Show comment
Hide comment
@kondlada

kondlada Apr 16, 2016

Hi I am using official aapt provided by android .

Build tool -23

Hi I am using official aapt provided by android .

Build tool -23

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 16, 2016

Owner

Yes exactly, official aapt has this problem.

Owner

iBotPeaches commented Apr 16, 2016

Yes exactly, official aapt has this problem.

@kondlada

This comment has been minimized.

Show comment
Hide comment
@kondlada

kondlada Apr 18, 2016

hi ,
I tried to add android manifest file but Still I am getting same error.

I: Using Apktool 2.1.0
I: Copying MOFAToken classes.dex file...
I: Building resources...
W: W/ResourceType( 1220): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 7533
W: ERROR: Platform AndroidManifest.xml is corrupt
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1)
: [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.exe, p, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F,
C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486887826729195.tmp, -0, arsc, -0, yaml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\De
sktop\Newfolder\dinesh\MOFAToken\res, -M, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:433)
        at brut.androlib.Androlib.buildResources(Androlib.java:371)
        at brut.androlib.Androlib.build(Androlib.java:281)
        at brut.androlib.Androlib.build(Androlib.java:254)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.
exe, p, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486
887826729195.tmp, -0, arsc, -0, yaml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\res, -M, C:\User
s\KH1148\Desktop\Newfolder\dinesh\MOFAToken\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:419)
        ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.exe, p, --min-sdk-version, 14, --
target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486887826729195.tmp, -0, arsc, -0, y
aml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\res, -M, C:\Users\KH1148\Desktop\Newfolder\dinesh
\MOFAToken\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:95)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:427)
        ... 6 more

kondlada commented Apr 18, 2016

hi ,
I tried to add android manifest file but Still I am getting same error.

I: Using Apktool 2.1.0
I: Copying MOFAToken classes.dex file...
I: Building resources...
W: W/ResourceType( 1220): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 7533
W: ERROR: Platform AndroidManifest.xml is corrupt
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1)
: [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.exe, p, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F,
C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486887826729195.tmp, -0, arsc, -0, yaml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\De
sktop\Newfolder\dinesh\MOFAToken\res, -M, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\AndroidManifest.xml]
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:433)
        at brut.androlib.Androlib.buildResources(Androlib.java:371)
        at brut.androlib.Androlib.build(Androlib.java:281)
        at brut.androlib.Androlib.build(Androlib.java:254)
        at brut.apktool.Main.cmdBuild(Main.java:224)
        at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.
exe, p, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486
887826729195.tmp, -0, arsc, -0, yaml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\res, -M, C:\User
s\KH1148\Desktop\Newfolder\dinesh\MOFAToken\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:419)
        ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\KH1148\Desktop\Newfolder\dinesh\aapt.exe, p, --min-sdk-version, 14, --
target-sdk-version, 23, --version-code, 1, --version-name, 1.1, -F, C:\Users\KH1148\AppData\Local\Temp\APKTOOL9136486887826729195.tmp, -0, arsc, -0, y
aml, -0, jcq, -0, ubm, -0, arsc, -I, .\1.apk, -S, C:\Users\KH1148\Desktop\Newfolder\dinesh\MOFAToken\res, -M, C:\Users\KH1148\Desktop\Newfolder\dinesh
\MOFAToken\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:95)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:427)
        ... 6 more
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 18, 2016

Owner

You gave it a bad AndroidManifest.xml file. You know the error says that in it :)

W: ERROR: Platform AndroidManifest.xml is corrupt
Owner

iBotPeaches commented Apr 18, 2016

You gave it a bad AndroidManifest.xml file. You know the error says that in it :)

W: ERROR: Platform AndroidManifest.xml is corrupt
@kondlada

This comment has been minimized.

Show comment
Hide comment
@kondlada

kondlada Apr 18, 2016

Yes error says that in it. I have just added Androidmanifest.xml using zip tool to framework 1.apk.

I copied the xml from 1.apk generated from apktool d --frame-path . sample.apk..

So can you please give me workaround for how to append Androidmanifest.xml . Can you also tell us when are you planning for next release which has this fix.

Thanks
Karthik

Yes error says that in it. I have just added Androidmanifest.xml using zip tool to framework 1.apk.

I copied the xml from 1.apk generated from apktool d --frame-path . sample.apk..

So can you please give me workaround for how to append Androidmanifest.xml . Can you also tell us when are you planning for next release which has this fix.

Thanks
Karthik

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 18, 2016

Owner

It appears from testing a fix that the inserted AndroidManifest.xml has to be a real one, but fake. So just have the xml tag and <manifest> tag. Not sure what attributes you need yet.

Apktool releases tend to be every 2-3 months. Our last release was March 27, so probably aiming for end of May/June for another release.

Owner

iBotPeaches commented Apr 18, 2016

It appears from testing a fix that the inserted AndroidManifest.xml has to be a real one, but fake. So just have the xml tag and <manifest> tag. Not sure what attributes you need yet.

Apktool releases tend to be every 2-3 months. Our last release was March 27, so probably aiming for end of May/June for another release.

@kondlada

This comment has been minimized.

Show comment
Hide comment
@kondlada

kondlada Apr 18, 2016

Thanks for prompt replies.
If you can give us dev apktool-2.X.jar file on these changes will be great. If yes can you please just give tentative date will be really help full.
As we do same script for amoung multiple applicaitons ,

Thanks for prompt replies.
If you can give us dev apktool-2.X.jar file on these changes will be great. If yes can you please just give tentative date will be really help full.
As we do same script for amoung multiple applicaitons ,

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 23, 2016

Owner

Fixed. Will be in 2.1.1

Owner

iBotPeaches commented Apr 23, 2016

Fixed. Will be in 2.1.1

@pradyukrish

This comment has been minimized.

Show comment
Hide comment
@pradyukrish

pradyukrish May 2, 2016

Hi @iBotPeaches , when can we expect 2.1.1 release?

Hi @iBotPeaches , when can we expect 2.1.1 release?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches May 2, 2016

Owner

Releases are every 2-3 months. The last release was March 27.

Owner

iBotPeaches commented May 2, 2016

Releases are every 2-3 months. The last release was March 27.

@pradyukrish

This comment has been minimized.

Show comment
Hide comment
@pradyukrish

pradyukrish May 4, 2016

@iBotPeaches Can you please point us to a nightly build or something so that we can continue working? We are blocked on our project. A nightly build would be a great help.

pradyukrish commented May 4, 2016

@iBotPeaches Can you please point us to a nightly build or something so that we can continue working? We are blocked on our project. A nightly build would be a great help.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches May 4, 2016

Owner

You are free to build your own. Instructions are here - http://ibotpeaches.github.io/Apktool/build/

Apktool doesn't currently have a nightly build site or anything, though it sounds interesting. However, I can't spend my time on such a feature when bugs deserve the time I set aside for the project.

Owner

iBotPeaches commented May 4, 2016

You are free to build your own. Instructions are here - http://ibotpeaches.github.io/Apktool/build/

Apktool doesn't currently have a nightly build site or anything, though it sounds interesting. However, I can't spend my time on such a feature when bugs deserve the time I set aside for the project.

@iBotPeaches iBotPeaches added this to the 2.1.1 milestone May 4, 2016

@medasf

This comment has been minimized.

Show comment
Hide comment
@medasf

medasf Apr 24, 2017


i have eror in aptool
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at brut.androlib.res.AndrolibResources.setVersionInfo(AndrolibResources.java:350)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.androlib.Androlib.build(Androlib.java:250)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)

medasf commented Apr 24, 2017


i have eror in aptool
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at brut.androlib.res.AndrolibResources.setVersionInfo(AndrolibResources.java:350)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.androlib.Androlib.build(Androlib.java:250)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)

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