gpt4 book ai didi

android - 无法在 android 中解析符号 'github'

转载 作者:行者123 更新时间:2023-12-05 00:04:25 26 4
gpt4 key购买 nike

我正在尝试像下面这样在 android 开发中导入 github。

import com.github.pires.obd.commands.protocol.EchoOffCommand;import 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 中添加这个依赖:

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

关于android - 无法在 android 中解析符号 'github',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63465552/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com