2017-10-01 13 views
2

안녕하세요 저는 드라이버 (?) androidthings에 대한 mpu6050의를 만들어 bintray https://dl.bintray.com/mechasolution/androidthings/Jcenter에 링크하기 전에 어떻게 Bintray에 업로드 한 모듈을 사용할 수 있습니까?

에 업로드 내가 성공적으로 다운로드하고 * .aar 라이브러리를 재사용 사촌 아니라 업로드 된 것 같다.

Jcenter에 연결하는 데 하루 정도 걸릴 것이라고 들었습니다. 링크되기 전에 테스트하기 위해 추가 코드가 필요합니다. 응용 프로그램의 build.gradle에서 프로젝트의 build.gradle

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
     maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
     classpath 'com.novoda:bintray-release:0.3.4' 
    } 
} 

을에서

dependencies { 
    ... 
    compile 'org.mechasolution:mpu6050:[email protected]' 
} 

아래 모듈

apply plugin: 'com.android.library' 
apply plugin: 'com.novoda.bintray-release' 

publish { 
    repoName = 'AndroidThings' 
    userOrg = 'mechasolution' 
    groupId = 'org.mechasolution' 
    artifactId = 'mpu6050' 
    publishVersion = '0.1' 
    desc = 'mpu6050 driver for AndroidThings provided by mechasolution' 
    website = 'https://github.com/mechasolution/mpu6050test' 
    issueTracker = "https://github.com/mechasolution/mpu6050test/issues" 
    repository = "https://github.com/mechasolution/mpu6050test.git" 
} 

build.gradle의입니다의 유지 올바른 코드 있지만, 안드로이드 스튜디오를 좋아하는 것 오류가 발생했습니다

오류 : (31, 13) 해결 실패 : org.mechasolution : mpu6050 : 0.1

내가 놓친 내용이나 잘못된 내용을 아는 사람이 있습니까?

+0

합니다. 환영하고 내 운전 기사를 시험해보십시오. https://github.com/mechasolution/mpu6050 테스트 매뉴얼 준비. 곧 jcenter와 연결될 것입니다. –

답변

2

당신은 당신의 루트 build.gradle (안 buildscript)에 allprojects에서 당신의 repo를 배치해야합니다 :

allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" } 
    } 
} 

Android Studio guide에서 : AndroidThings에있는 contrib 드라이버 mpu6050을 찾는 사람들을 위해

The allprojects block is where you configure the repositories and dependencies used by all modules in your project, such as third-party plugins or libraries. Dependencies that are not required by all the modules in the project should be configured in module-level build.gradle files

+0

와우 효과가 있습니다. 고마워. 나는 이것을 하루 정도 보냈다. 내가 읽은 게시물이 오래되었거나 작가가 잘못된 정보를 준 것처럼 보입니다. 다시 한번 감사드립니다. –