相关疑难解决方法(0)

Android Studio说"无法解析符号",但项目编译

我在AndroidStudio中导入twitter4j,在build.gradle中使用以下内容:

dependencies {
  compile 'com.android.support:support-v4:18.0.+'
  compile files('libs/twitter4j-core-3.0.4.jar')
}
Run Code Online (Sandbox Code Playgroud)

项目编译得很好,我可以毫无问题地创建twitter对象.但是,在Android studio中,引用该库的任何内容都显示"无法解析符号"并显示为红色.要让Android Studio识别库,我需要做些什么?

我已经尝试重建项目,./ gradlew clean,关闭并重新打开我的项目.

android android-studio

93
推荐指数
7
解决办法
11万
查看次数

将Android Studio项目与Gradle文件同步

我正在开发一个项目,然后我得到了更新Android Studio的提示.在我这样做之后,我在尝试运行我的应用程序时开始出现此错误 错误

它说

该项目可能需要与Gradle文件同步

我该如何解决这个问题?

android android-studio

54
推荐指数
2
解决办法
11万
查看次数

Android Studio:未找到构建变体错误

我是 android 开发的新手,我开始在网上购买的项目上从头开始开发,按照文档,我遇到了一个错误,说没有找到“应用程序”的变体。检查构建文件以确保至少存在一种变体。

这是 build.gradle 代码

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
    applicationId "com.app-10.app"
    minSdkVersion 23
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Third Party Libraries
//Glide library for image fetching from the web
implementation 'com.github.bumptech.glide:glide:4.9.0' …
Run Code Online (Sandbox Code Playgroud)

android build variant android-studio android-gradle-plugin

25
推荐指数
3
解决办法
4万
查看次数

如何使用终端命令执行"Gradle sync"?

如何在linux中通过命令运行gradle sync?我不想要"gradle build"因为我知道这会同步和构建.我只想要一个命令,它可以在Android Studio中执行"与gradle文件同步项目"按钮.

android gradle

21
推荐指数
2
解决办法
5698
查看次数

16
推荐指数
7
解决办法
1万
查看次数

Android Studio 中的“立即同步”按钮在哪里?

我正在关注这个 Tensorflow教程。在底部,它显示单击“立即同步”。那到底是什么?

android android-studio

5
推荐指数
1
解决办法
1万
查看次数