0

There is a very good instruction in Redex page at http://fbredex.com/.

I follow the instruction but I have problem in two steps.

1.I have no problem with run of first command (my OS is Ubuntu)

sudo apt-get install \
    g++ \
    automake \
    autoconf \
    autoconf-archive \
    libtool \
    libboost-all-dev \
    libevent-dev \
    libdouble-conversion-dev \
    libgoogle-glog-dev \
    libgflags-dev \
    liblz4-dev \
    liblzma-dev \
    libsnappy-dev \
    make \
    zlib1g-dev \
    binutils-dev \
    libjemalloc-dev \
    libssl-dev \
    libiberty-dev
  1. I clone folly repo somewhere on my laptop

  2. I go to the directory by $ cd android/projects/folly/folly/

  3. I run git submodule update --init but nothing happens. I even run this command in $ cd android/projects/folly/ but nothing happens either.

  4. I run autoreconf -ivf && ./configure && make && make install. Seems works as I see process takes around a minute or two and there are a lot og messages print out.

  5. I copy/paste a sample .apk file to my Desktop and run redex ~/Desktop/my_android_app.apk -o ~/Desktop/my_android_app-redexed.apk. However, I'm getting this message on terminal.

    No command 'redex' found, did you mean: Command 'redet' from package 'redet' (universe) redex: command not found

I ran above command when I am in /home/hesam/android/projects/folly/folly or /home/hesam/android/projects/folly/. But I get same output.

Update

I cloned Redex repo and followed Bert's Instruction. It works and I could see something is happening by running git submodule update --init. So thanks to Bert. However, I got error at the end of autoreconf -ivf && ./configure && make && make install command.

Please have a look at following output:

Making all in unit
make[3]: Entering directory `/home/hesam/android/projects/redex/test/unit'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/hesam/android/projects/redex/test/unit'
make[2]: Leaving directory `/home/hesam/android/projects/redex/test'
make[1]: Leaving directory `/home/hesam/android/projects/redex'
Making install in third-party/folly/folly
make[1]: Entering directory `/home/hesam/android/projects/redex/third-party/folly/folly'
Making install in .
make[2]: Entering directory `/home/hesam/android/projects/redex/third-party/folly/folly'
make[3]: Entering directory `/home/hesam/android/projects/redex/third-party/folly/folly'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libfolly.la libfollybenchmark.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libfolly.so.57.0.0 /usr/local/lib/libfolly.so.57.0.0
/usr/bin/install: cannot create regular file '/usr/local/lib/libfolly.so.57.0.0': Permission denied
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Leaving directory `/home/hesam/android/projects/redex/third-party/folly/folly'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/hesam/android/projects/redex/third-party/folly/folly'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/hesam/android/projects/redex/third-party/folly/folly'
make: *** [install-recursive] Error 1
hesam: redex (master) $ redex ~/Desktop/my_android_app.apk -o ~/Desktop/my_android_app-redexed.apk 
No command 'redex' found, did you mean:
 Command 'redet' from package 'redet' (universe)
redex: command not found
hesam: redex (master) $ 
halfer
  • 19,824
  • 17
  • 99
  • 186
Hesam
  • 52,260
  • 74
  • 224
  • 365
  • Read the issues on Github. People have had your problem and there are answer on how to solve it – WizKid Apr 15 '16 at 19:33

2 Answers2

1

You don't need to separately clone folly; it's included as a submodule of redex. Just do: git clone https://github.com/facebook/redex.git cd redex git submodule update --init and then configure/make according to the instructions.

BertMaher
  • 31
  • 2
  • Hi Bert. Thanks for your reply. You instruction helped me to fix my first problem. However, my second problem is still exist. Please have a look at update. Thanks. – Hesam Apr 16 '16 at 22:49
  • 1.autoreconf -ivf && ./configure && make 2.sudo make install run this command after the above answer command and u will get redex command recognized. – Avinash Ranjan Apr 18 '16 at 07:19
1

there is a difference regard instructions you see in fbredex and what you see in Github redex page. Please follow what Github page says for make and install.

autoreconf -ivf && ./configure && make
sudo make install

Regard my above problem, A developer from Redex team called me and after few minutes he found and solved the problem. He has updated FAQ section on Redex page that you can see at here. Since there is no explanation there I copy/paste what he said on chat.

So, as an optimization, the runtime linker doesn't actually go trawling through everything to look for libs anymore It uses the cache file, which is generated by ldconfig

Update

I forgot to mention that you must have ANDROID_SDK in your PATH. I have following paths in my .profile. Don't forget to source it after making change in it. ~/android/sdk is path to my Android SDK directory.

export ANDROID_HOME=~/android/sdk
export ANDROID_SDK=${ANDROID_HOME}
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Hesam
  • 52,260
  • 74
  • 224
  • 365