我将构建和目标版本更新为28(Pie),并替换了相关的依赖项。现在我的项目说在上找不到符号AppCompatActivity。我试图
但是结果是一样的。而且,当我在活动类中的extends关键字之后尝试Ctrl+时Space,没有任何"AppCompatActivity建议。我试图调查它是否存在于libraries文件夹中,是否存在于文件夹中。
现在,我应该怎么做才能使其正常工作?如果库有任何变化/替代,androidx请告诉我。这是我的完整build.gradle文件
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.invogen.messagingapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation 'com.android.support:appcompat-v7:28.0.0'
// implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// implementation 'com.android.support:design:28.0.0'
// implementation 'com.android.support:support-v4:28.0.0'
// Libs for newer …Run Code Online (Sandbox Code Playgroud) 好吧,我开始从一个有多年历史的项目迁移到AndroidX(此后从此一直未动),但我在资源和gradle构建方面遇到了问题。我完全被新的名称空间迷住了,我更改了一些名称空间,升级了AndroidStudio告诉我的所有内容,但仍然无法识别项目中的内容。我将两个gradle都粘贴到这里,然后将错误放在下面。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
模组
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.usuario.tm"
minSdkVersion 15
targetSdkVersion …Run Code Online (Sandbox Code Playgroud) 我已经提到了这个线程,但是它不能解决我的问题。
我不断收到错误消息:
ERROR: Failed to resolve: com.android.support:appcompat-v7:29.0.1
每次尝试刷新Gradle时,在Android Studio中。
这是我的 build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.application.app"
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:29.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决?还有一个网站列出了所有android模块的所有版本?我自己找不到任何人。
谢谢。
android android-appcompat android-support-library android-gradle-plugin androidx
我只想补充徽章了menuItem的BottomNavigationView我的应用程序。我使用的BottomNavigationView是材料组件库(版本1.1.0-alpha08),因为它的最新版本是在7天前发布的,所以我没有找到与此相同的任何教程,因为该版本的BottomNavigationView“的showBadge方法,我们不能使用该方法。
我试过了的实例调用getBadge和getOrCreateBadge方法BottomNavigationView。
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
if (bottomNavigationView.getBadge(3) == null) {
audioPlayingCountBadge = bottomNavigationView.getOrCreateBadge(3);
audioPlayingCountBadge.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
} else {
audioPlayingCountBadge = bottomNavigationView.getBadge(3);
}
audioPlayingCountBadge.setVisible(true);
Run Code Online (Sandbox Code Playgroud)
我在android开发中是菜鸟,所以如果有人可以提供详细解决此问题的方法,这将非常感激我。
我再次回去工作以完成我的申请,但是当应用程序开始同步时,它给了我
无法解决:androidx 受影响的模块:href="openFile:D:/.android/Step View/Application/Source Code/app/build.gradle">app
我看到这样的问题,但它对我不起作用。对不起,我的英语不好。
这是我的等级。应用程序
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven {
url 'https://maven.google.com'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.xcoder.stepview"
minSdkVersion 17
targetSdkVersion 28
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.connection_light.runner.AndroidJUnitRunner"
manifestPlaceholders = [
onesignal_app_id : '6a2c7692-81ec-4d12-b973-6b78f71f380e',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
}
buildTypes { …Run Code Online (Sandbox Code Playgroud) android ×5
gradle ×3
androidx ×2
build.gradle ×1
java ×1
material-components-android ×1
resources ×1