안녕하세요!! 여기서 자주 눈팅만 하다가 감당 못할 오류가 나서 며칠째 끙끙대다가 전문가분들의 조언좀 듣고자 이렇게 보냅니다.. ㅠㅠ
제가 구글맵말고 다른 맵이 필요해서 Mapbox라는 곳에서 SDK를 받아서 하는 취지로,
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0'
}
com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0 을 컴파일 했습니다.
File->Project Structure -> Dependencies에서 Library Dependency로 검색해서 등록했구요.
사이트에서는,
--------------------------------------------------------------------------------------------------------------------
We recommend installing with Gradle. This will automatically install the necessary dependencies and pull the SDK binaries from the Maven Central repository Mapbox Android SDK on Maven Central.
To install the current stable version add this to your build.gradle:
repositories {
mavenCentral()
}
dependencies {
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0@aar'){
transitive=true
}
}
To install the current SNAPSHOT version add this to your build.gradle:
repositories {
mavenCentral()
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:3.1.0-SNAPSHOT@aar'){
transitive=true
}
}
---------------------------------------------------------------------------------------------------------------------
이렇게 추가하라 했는데, 이것을 그냥 repositories랑 dependencies에 붙이면 된다고 하는 것 같아서 붙였는데, 오류가 나서 이것은 추가하지 않았습니다. 대신에 제가 적었던 위쪽 방식을 사용했구요..
만약 제가 추가하면
---------------------------------------------------------------------------------------------------------------------
Error:(9, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'My Application' may be using a version of Gradle that does not contain the method.
Gradle settings
The build file may be missing a Gradle plugin.
Apply Gradle plugin
---------------------------------------------------------------------------------------------------------------------
이렇게 오류가 나버립니다 ㅠㅠ 그래서 저는 이걸 사용을 안하고...
제 gradle 화면입니다.(기본 셋팅입니다.)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
이거 외에는 아무것도 세팅하지 않았습니다. 애초에 새 프로젝트로 시험해 본거라 (Empty Activity) 아무것도 없는 빈 화면이구요..
제 컴이나 설정 문제인가 해서 다른 컴으로 다시 시도해봤는데 똑같은 오류가 납니다.
문제의 오류는
---------------------------------------------------------------------------------------------------------------------
C:\Users\LeeJaeJun\Desktop\programming\Android\WorkPlace\MyApplication\app\build.gradle
Warning:Module 'com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0' depends on one or more Android Libraries but is a jar
----------------------------------------------------------------------------------------------------------------------
이것입니다..ㅠㅠ 이것은 추가를 해서 OK를 눌러서 gradle 추가할 때 이 Warning이 나오며, 그냥 경고일 수도 있어서 실행을 해봤는데도, 똑같은 경고와 함께, 오류가 나네요..
----------------------------------------------------------------------------------------------------------------------
Information:Gradle tasks [:app:assembleDebug]
Warning:Module 'com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0' depends on one or more Android Libraries but is a jar
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareDebugDependencies
Module 'com.mapbox.mapboxsdk:mapbox-android-sdk:3.0.0' depends on one or more Android Libraries but is a jar
Error:Execution failed for task ':app:prepareDebugDependencies'.
> Dependency Error. See console for details.
Information:BUILD FAILED
Information:Total time: 0.775 secs
Information:1 error
----------------------------------------------------------------------------------------------------------------------
이것때문에 구글링이란 구글링은 다해봤는데도 잘 모르겠네요.. 정보가 잘 없는건지 제가 못찾는건지..
며칠째 진전이 없이 고민중입니다..ㅠㅠ 제발 부탁드립니다.. 추가적인 정보를 원하시면 바로바로 다 보여드리겠습니다.
P.s 잘은 모르겠지만, 다른 사람들은 잘 사용하는 것 같습니다..SDK 자체는 문제가 없다는거 같은데.. 저만의 문제인지.. 답답하네요 ㅠ