question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BLOCKER - 2.5.1] AAPT not usable on macOS

See original GitHub issue

Information

  1. Apktool Version (apktool -version) 2.5.0
  2. Operating System (Mac, Linux, Windows) macOS 11.1
  3. APK From? (Playstore, ROM, Other) Playstore

Stacktrace/Logcat

I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: dyld: Library not loaded: @rpath/libc++.dylib
W:   Referenced from: /var/folders/5l/f30qm99143n7lf9dd1_pb5v40000gn/T/brut_util_Jar_22487465168643078285790281712635730641.tmp
W:   Reason: image not found
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 134): [/var/folders/5l/f30qm99143n7lf9dd1_pb5v40000gn/T/brut_util_Jar_22487465168643078285790281712635730641.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 29, --version-code, 308001336, --version-name, 8.0.1, --no-version-vectors, -F, /var/folders/5l/f30qm99143n7lf9dd1_pb5v40000gn/T/APKTOOL3306739641509490829.tmp, -e, /var/folders/5l/f30qm99143n7lf9dd1_pb5v40000gn/T/APKTOOL2214957322552063658.tmp, -0, arsc, -I, /Users/kotori0/Library/apktool/framework/1.apk, -S, /[REDACTED]/input/res, -M, /[REDACTED]/input/AndroidManifest.xml]

Steps to Reproduce

  1. decompile anything with apktool d xxx.apk
  2. recompile with java -jar apktool.jar b xxx -o out.apk

Frameworks

N/A

APK

Not related, can reproduce with any apk.

Questions to ask before submission

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

libc++.dylib is actually not exist. I have Xcode and command line tools installed. Also found this on Apple forum so I’m not sure if it’s an Apple’s bug.

% ls /usr/lib
charset.alias			libpython2.7.dylib
cron				libstdc++.6.dylib
dsc_extractor.bundle		libstdc++.dylib
dtrace				log
dyld				pam
groff				php
libLeaksAtExit.dylib		pkgconfig
libMTLCapture.dylib		python2.7
libffi-trampolines.dylib	rpcsvc
libgmalloc.dylib		ruby
libhunspell-1.2.0.dylib		sasl2
libhunspell-1.2.dylib		sqlite3
libiodbc.2.dylib		swift
libiodbc.dylib			system
libiodbcinst.2.dylib		updaters
libiodbcinst.dylib		xpc
libobjc-trampolines.dylib	zsh
libpython.dylib

Also I tried to execute aapt_64 and got same result

% ./aapt_64
dyld: Library not loaded: @rpath/libc++.dylib
  Referenced from: /Users/kotori0/code/PLC801/apktool/prebuilt/macosx/./aapt_64
  Reason: image not found
zsh: abort      ./aapt_64

While aapt2 seems working.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iBotPeachescommented, Aug 29, 2021

Okay confirmed new binaries are static.

➜  macosx git:(aapt1-static-mac) otool -L *
aapt2_64:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
aapt_64:
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
➜  macosx git:(aapt1-static-mac) 
1reaction
iBotPeachescommented, Jul 7, 2021

This is the last ticket before 2.5.1 is sliced and still having troubles building Mac binary. They are making this very tough to build platform/build tools on Mac.

Read more comments on GitHub >

github_iconTop Results From Across the Web

macos - Android aapt can not be found on Mac - Stack Overflow
I am getting the following error when trying to compile my android project in IntelliJ (v11.1) on MacOSX. I/O error: Cannot run program...
Read more >
Allow or block pop-ups in Safari on Mac - Apple Support
Allow or block pop-ups on one website. In the Safari app on your Mac, go to the website. Choose Safari > Settings, then...
Read more >
R for macOS FAQ - R Project
1 Introduction. This document contains a user guide to the R.APP version of R , and information on using R on macOS which...
Read more >
WorkSpaces macOS client application - AWS Documentation
Release Date Changes 5.5.0 November 14, 2022 Updated the WSP client SDK. 5.3.0 September 15, 2022 Bug fixes and enhancements. 5.1.0 June 30, 2022 Updated PCoIP...
Read more >
MySQL Workbench Manual :: 2.5.1 Installing
2.5.1 Installing. MySQL Workbench for macOS is distributed as a DMG file. The file is named mysql-workbench-community- version -osx.dmg , where version is ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found