【问题标题】:Cannot resolve symbol 'github' in android无法在android中解析符号'github'
【发布时间】:2020-08-18 17:57:53
【问题描述】:

我正在尝试在 android 开发中导入 github,如下所示。

导入 com.github.pires.obd.commands.protocol.EchoOffCommand; 导入 com.github.pires.obd.enums.ObdProtocols;

但收到类似 Cannot resolve symbol 'github'

之类的错误消息

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    google()
    jcenter()

}
dependencies {
    classpath "com.android.tools.build:gradle:4.0.0"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
    maven {
        url 'https://jitpack.io'
    }

}
 }

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

应用build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
    applicationId "sss.sss.obdapp"
    minSdkVersion 16
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.google.code.gson:gson:2.8.6'
//noinspection OutdatedLibrary
implementation 'com.fazecast:jSerialComm:2.0.2'
implementation 'com.android.volley:volley:1.1.0'
//noinspection GradleCompatible

}

你能帮我解决这个错误吗?

【问题讨论】:

  • 在您的build.gradle 中添加implementation 'com.github.pires:obd-java-api:1.0'

标签: android github


【解决方案1】:

添加你的build.gradle这个依赖:

dependencies {
   //..
   implementation 'com.github.pires:obd-java-api:1.0'
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-09
    • 2017-01-09
    • 1970-01-01
    • 2018-05-03
    • 1970-01-01
    • 2016-06-15
    • 2017-02-09
    相关资源
    最近更新 更多