问题
When I run the aapt dump badging on my apk I get the below error
W/asset (17217): Asset path Users/username/Downloads/appname.apk is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded
I couldn't find why it happens.
I'm using iMac.
回答1:
I have faced this problem in my case it was missing of the (.)dot in following terminal command
./aapt dump badging /Users/username/Documents/Android/Release/PROD/appname.apk
Hope this helps
回答2:
I come this issue with
sudo -u www /usr/share/aapt/aapt d badging /home/roofe/200.apk
getFileType got errno=13 on '/home/roofe/200.apk'
getFileType got errno=13 on '/home/roofe/200.apk'
W/asset ( 1315): Asset path /home/roofe/200.apk is neither a directory nor file (type=0).
ERROR: dump failed because assets could not be loaded
But when I use sudo /usr/share/aapt/aapt d badging /home/roofe/200.apk
, it works well. So I realise it's caused by permission.
Then I move the file to /data/www
where the full path have the mode www:www
, and it works.
来源:https://stackoverflow.com/questions/26653704/aapt-dump-badging-fails-dump-failed-because-assets-could-not-be-loaded