无法解决:库

时间:2018-05-21 09:45:03

标签: android gradle

我想使用这个库

implementation('com.ubudu.beacon:ubudu-ble-scanner-sdk:1.6.2@aar') {
    transitive = true
}

但是我无法理解,我不知道为什么,当我访问该链接时,它可以正常工作。

http://nexus.ubudu.com:8081/nexus/content/groups/public/com/ubudu/beacon/ubudu-ble-scanner-sdk/1.6.2/

这是我项目的gradle文件:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

2 个答案:

答案 0 :(得分:1)

将此行添加到根级build.gradle

allprojects {
repositories {
    mavenCentral()
    maven { url 'http://nexus.ubudu.com:8081/nexus/content/groups/public/' }
    }
}

答案 1 :(得分:1)

确保添加

import React, { Component } from 'react';
import { adalApiFetch } from './adalConfig';

class App extends Component {

  state = {
    apiResponse: ''
  };

  componentDidMount() {

    // We're using Fetch as the method to be called, and the /me endpoint 
    // from Microsoft Graph as the REST API request to make.
    adalApiFetch(fetch, 'https://graph.microsoft.com/v1.0/me', {})
      .then((response) => {

        // This is where you deal with your API response. In this case, we            
        // interpret the response as JSON, and then call `setState` with the
        // pretty-printed JSON-stringified object.
        response.json()
          .then((responseJson) => {
            this.setState({ apiResponse: JSON.stringify(responseJson, null, 2) })
          });
      })
      .catch((error) => {

        // Don't forget to handle errors!
        console.error(error);
      })
  }

  render() {
    return (
      <div>
        <p>API response:</p>
        <pre>{ this.state.apiResponse }</pre>
      </div>
    );
  }
}

export default App;
repositories { mavenCentral() maven { url 'http://nexus.ubudu.com:8081/nexus/content/groups/public/'} }

中的