Android Advanced Journey | Use of android studio freeline

Table of contents

    1. Why use freeline?
    2. Installation and use    

Why use freeline

The compilation of andrdoi studio itself is very slow, and some can take more than 10 minutes, which is very unbearable for a developer. There is a fast compilation tool that can save you several hours a day.

    Environmental requirements 

    1) Gradle version must be 2.1.4+.

 Install and use Freeline

    1. Open your android studio ->file->settings->plugins

2. Search freeline 

After the installation is complete, you will find an additional icon on android studio

3. But it won’t run if you click it. Next, you need to configure the Python 2.7+ version environment. (Freeline currently supports version 2.7+, but does not support version 3.6+--it cannot be used when testing 3.7, and it prompts that various models do not exist) The installation package address of python2.7.9 is given below (note: the author has installed 3 versions pyhon, there is no problem with the following version) Students using mac ignore the installation of Python, because Apple system has installed Python by default.

The following is the installation version of the Windows version 64bit

python2.7.9 installation package address

More versions:

https://www.python.org/downloads/ zh

4. Click to open python and check the following. The last red circle check automatically adds environment variables to the path. Then there is the brainless next->next..

5. If the installation is successful, run ->cmd->enter python. Obviously the version number will come out. .

6. Next, add the following project configuration to the project root directory build.gradle:

classpath 'com.antfortune.freeline:gradle:0.8.2':

Add them in turn in the build.gradle of the module project

    applyplugin:'com.antfortune.freeline'

    freeline {

        hack true

    }

    debugCompile 'com.antfortune.freeline:runtime:0.6.2'

    releaseCompile 'com.antfortune.freeline:runtime-no-op:0.6.2'

    testCompile 'com.antfortune.freeline:runtime-no-op:0.6.2'


 

And add FreelineCore.init(this) to your application; this method is deprecated in the new version.

The installation is complete here.

use

1) Enter gradlew clean in the freeline window of as to clean the project

2) Enter in the freeline window of as: gradlew initFreeline -Pmirror, initialize the configuration (it takes a long time)

3) Enter: Python freeline.py in the as freeline window to start compilation (or click the freeline icon in the android studio toolbar)

I tested it, and it didn't take a few seconds to compile. I just modified the official/test environment.

I installed the latest version of python before, and various models did not exist.

If you encounter such a problem, consider using version 2.7 of python

Special thanks to:

https://www.jianshu.com/p/8e5a41fb224f?mType=Group

Guess you like

Origin blog.csdn.net/weixin_42504805/article/details/131634067