Compilation error in Android Studio When making a simple Google Android Maps API v2 project

后端 未结 2 647
醉酒成梦
醉酒成梦 2021-01-12 18:52

Recently I migrated to the New Android Studio IDE based on IntelliJ

The Guides i followed were:

  1. https://developers.google.com/maps/

相关标签:
2条回答
  • 2021-01-12 19:08

    I was following the same instructions except I was creating a new project. Under the project structure I removed the Android-Gradle facet and was able to build successfully. Optionally one can update the gradle build files and add the Android-Gradle facet to the play services library.

    NOTE: I changed the name of Google Play Services directory.

    build.gradle for Google Play Services library.

    apply plugin: 'android-library'
    
    buildscript {
        repositories {
            mavenCentral()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:0.4'
        }
    }
    
    dependencies {
        compile files('libs/android-support-v4.jar')
        compile files('google-play-services.jar')
    }
    
    android {
        compileSdkVersion 17
        buildToolsVersion '17.0.0'
    
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aild.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }
    }
    

    build.gradle for test app.

    buildscript {
        repositories {
            maven { url 'http://repo1.maven.org/maven2' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.4'
        }
    }
    apply plugin: 'android'
    
    dependencies {
        compile files('libs/android-support-v4.jar')
        compile project(':lib-google-play-services')
        compile files('../lib-google-play-services/libs/google-play-services.jar')
    }
    
    android {
        compileSdkVersion 17
        buildToolsVersion "17.0.0"
    
        defaultConfig {
            minSdkVersion 11
            targetSdkVersion 16
        }
    }
    
    0 讨论(0)
  • 2021-01-12 19:24

    First you must give more information about the error. Instead of using the external compiler you must try to use the internal compiler (changing the compiler settings)

    0 讨论(0)
提交回复
热议问题