2

我创建了一个简单的项目来在 android studio 下测试 Google Api,但是我遇到了这个错误,我试图通过将 maps.jar 添加到项目结构的库中来纠正它:

    Information:Compilation completed with 12 errors and 0 warnings in 17 sec
Information:12 errors
Information:0 warnings
/home/phenix-dz/AndroidStudioProjects/Geolocalisation/Geolocalisation/src/main/java/com/example/geolocalisation/MainActivity.java
    Error:Error:line (4)Gradle: error: package com.google.android.maps does not exist
    Error:Error:line (5)Gradle: error: package com.google.android.maps does not exist
    Error:Error:line (6)Gradle: error: package com.google.android.maps does not exist
    Error:Error:line (9)Gradle: error: cannot find symbol class MapActivity
    Error:Error:line (11)Gradle: error: cannot find symbol class MapView
    Error:Error:line (12)Gradle: error: cannot find symbol class MapController
    Error:Error:line (16)Gradle: error: cannot find symbol variable super
    Error:Error:line (17)Gradle: error: cannot find symbol method setContentView(int)
    Error:Error:line (19)Gradle: error: cannot find symbol class MapView
    Error:Error:line (19)Gradle: error: cannot find symbol method findViewById(int)
    Error:Error:line (14)Gradle: error: method does not override or implement a method from a supertype
    Error:Error:line (25)Gradle: error: method does not override or implement a method from a supertype

我也尝试添加此代码:

apply plugin: "java"

    dependencies {
        compile files('/home/phenix-dz/android-studio/sdk/add-ons/google_apis-671458-mac-x86/libs/maps.jar')

} 

在 build.gradle 文件中,但它给了我同样的错误。

谢谢

4

0 回答 0