After importing to Android studio, the Build.grade of the project was discovered.
Buildscript { repositories { mavencentral () } dependencies { classpath ' Com.android.tools.build:gradle:1.0.0-rc1 ' }}
This is not compiled, refer to the official note:
Http://tools.android.com/tech-docs/new-build-system/user-guide
Edit into this:
Top-level build file where can add configuration options common to all Sub-projects/modules.buildscript {Reposi Tories {mavencentral ()} dependencies {classpath ' Com.android.tools.build:gradle:1.0.0-rc1 '}}app Ly plugin: ' Android ' dependencies {compile filetree (dir: ' Libs ', include: ' *.jar ') compile ' COM.ANDROID.SUPPORT:APPC ompat-v7:21.0.+ ' Compile project (': Libraries:appirater-android ')}android {compilesdkversion] Buildtoolsversion "21.1.1" Sourcesets {main {manifest.srcfile ' androidmanifest.xml ' java.srcdirs = [' src ' ] Resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscript.srcdirs = [' src '] Res.srcdirs = [' res '] assets.srcdirs = [' assets '] jnilibs.srcdirs = [' Libs ']}/ /Move The tests to Tests/java, tests/res, etc ... Instrumenttest.setroot (' tests ')//Move The build types to Build-types/<type> For instance, Build-types/debug/java, Build-types/debug/androidmanifest.xml, ...//This moves them out of them Default location under src/<type>/... which would//conflict with src/being used by the main source set. Adding New build types or product flavors should be accompanied//by a similar customization. Debug.setroot (' Build-types/debug ') release.setroot (' Build-types/release ')}} Introducing Dependencies
dependencies { Compile filetree (dir: ' Libs ', include: ' *.jar ') compile ' com.android.support:appcompat-v7 : 21.0.+ ' Compile project (': Libraries:appirater-android ')}
Here's the dependency on that.
The first line is dependent on the jar file inside the Libs folder
The second line is the library that relies on MAVEN libraries
The third line is dependent on a library project, the directory is libraries/appirate-android
Include So files
Jnilibs.srcdirs = [' Libs ']
Android Studio does not include the so file in Libs, and if so, it is placed in the Main/jnilibs directory by default. Because my project was transferred from Eclipse, I need to specify the directory manually.
Android Eclipse Project turned into an Android studio project encountered problems