Android import other project problem

The previous project, the demo of Bluetooth Ble, became popular on android and could not be built. The solution is as follows:

1. If build.gradle and setting.gradle are missing under the project, copy these two files from other projects to the demo project

Among them, build.gradle generally does not need to be modified, which is a general configuration. In setting.gradle, change it to your project name. Rebuilds the project after saving

2. If the dependencies of other modules are needed during the build process, put the module dependencies in the project folder and modify the first sentence of the dependent build.gradle

apply plugin: 'com.android.library'

Of course, the general module is already library by default. Then include the module name in the settings.gradle file in the top-level project directory: include ':app','moudle-name'

include ':app', ':judgesdk'

3. If you use bufferknife in your dependencies and an error is reported, the solution is as follows: Add the following code to build.gradle

android {

    ...

    defaultConfig {

    ...

        javaCompileOptions {

annotationProcessorOptions {

includeCompileClasspath = true

}

}

}}


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325729286&siteId=291194637