Android Eclipse Project turned into an Android studio project encountered problems

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.