小编lba*_*ira的帖子

项目更新推荐:Android Gradle Plugin可升级。错误消息:在构建文件中找不到 AGP 版本

在 Android Studio 中建议将 Android Gradle 插件从 7.0.0 升级到 7.0.2 后,升级助手通知Cannot find AGP version in build files,因此我无法进行升级。

我该怎么办?

谢谢

build.gradle 中的代码(项目)

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath Libs.androidGradlePlugin
        classpath Libs.Kotlin.gradlePlugin
        classpath Libs.Hilt.gradlePlugin
    }
}

plugins {
    id 'com.diffplug.spotless' version '5.12.4'
}

subprojects {
    repositories {
        google()
        mavenCentral()

        if (!Libs.AndroidX.Compose.snapshot.isEmpty()) {
            maven { url Urls.composeSnapshotRepo }
        }

        if (Libs.Accompanist.version.endsWith('SNAPSHOT')) {
            maven { url Urls.mavenCentralSnapshotRepo }
        }
    }

    apply plugin: 'com.diffplug.spotless'
    spotless {
        kotlin {
            target '**/*.kt' …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio android-gradle-plugin

13
推荐指数
1
解决办法
9977
查看次数

布局检查器不显示可组合项树

当我在设备上正在运行的撰写应用程序中使用布局检查器时,我没有获取可组合项树,而是获取了视图系统树。如何查看可组合项树?谢谢

在此输入图像描述

注意:当我在 Android Studio 中运行布局检查器时,我仍然收到以下错误:
Unable to set the global setting: "debug_view_attributes_application_package" to: "com.example.statecodelab" Error: Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2340) at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1405) at com.android.providers.settings.SettingsProvider.insertGlobalSetting(SettingsProvider.java:1379) at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:556) at android.content.ContentProvider.call(ContentProvider.java:2162) at android.content.ContentProvider$Transport.call(ContentProvider.java:481) at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:375) at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:277) at android.os.ShellCommand.exec(ShellCommand.java:104) at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:49) at android.os.Binder.shellCommand(Binder.java:881) at android.os.Binder.onTransact(Binder.java:765) at android.os.Binder.execTransactInternal(Binder.java:1021) at android.os.Binder.execTransact(Binder.java:994)

android kotlin android-jetpack-compose

12
推荐指数
2
解决办法
7998
查看次数

我如何准备要发布的 Jetpack compose 应用程序,@Preview 可组合项怎么样?

我的 Jetpack compose 应用程序的源代码加载了 @Preview 可组合项。

我通过从源代码中删除所有这些 @Preview 可组合项来准备发布我的应用程序,就像我们所做的那样,例如,使用日志方法。

有什么办法可以自动化这个删除过程吗?此外,真的有必要从源代码中删除 @Preview 可组合项吗?

谢谢,

android kotlin android-jetpack android-jetpack-compose

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