标签: android

无法获得未知属性“manifestOutputDirectory”

我正在尝试使用 Android Studio“制作项目”,但出现此错误:

任务“:myApp:processGoogleDebugManifest”执行失败。

无法获取类型为 com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest 的任务“:myApp:processGoogleDebugManifest”的未知属性“manifestOutputDirectory”。

请问有什么帮助吗?

编辑:此错误发生在我更新到 gradle v6.5 和插件 v4.1.0 之后。如果我恢复到 gradle v6.1.1 和插件 v4.0.0,错误就会消失。

android android-studio react-native huawei-mobile-services

35
推荐指数
2
解决办法
7082
查看次数

参数类型“颜色?” 无法分配给参数类型“MaterialColor?”

在此输入图像描述

我想在flutter中设置背景Colors.yellow[700],但是当我添加符号“[]”或Colors.yellow.shade600时,但我无法设置背景的值。它显示错误并且错误是

The argument type 'MaterialColor' can't be assigned to the parameter type 'Paint'
Run Code Online (Sandbox Code Playgroud)

android visual-studio dart flutter

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

Flutter-在M1 Apple Silicon 上更新android studio Arctic Fox(2020.3.1) 后,找不到捆绑的Java 版本(flutter doctor)

我面临奇怪的问题。在我更新我的 Android Studio 之前,flutter doctor 一切正常。一旦我更新了 Android Studio,当我运行医生时,它会显示“无法找到捆绑的 Java 版本”。我已经下载了 Java 安装程序并安装在我的 M1 Mac 上,但是重新启动后,运行 flutter doctor 仍然显示相同的错误。奇怪的是,当我卸载北极狐版本并重新安装旧的 Android Studio 版本时,运行医生时一切正常。如果你们中有人遇到过这个问题,请帮忙指点一下。谢谢

android flutter apple-silicon apple-m1

35
推荐指数
7
解决办法
2万
查看次数

Markdown 编辑器和预览在 Android Studio 中无法运行?

我当前安装了这两个插件:

  1. https://plugins.jetbrains.com/plugin/17254-markdown-editor
  2. https://plugins.jetbrains.com/plugin/7793-markdown

这些都不起作用。

我用谷歌搜索了这个问题,发现很多人都面临着同样的问题。但我发现的一些解决方案对我不起作用

markdown android kotlin android-studio

35
推荐指数
1
解决办法
8799
查看次数

在 Android 12 (SDK 31) 中获取 android.app.ForegroundServiceStartNotAllowedException

我将我的应用程序升级targetSdkVersioncompileSdkVersionSDK 31,并开始在后台更新小部件的服务中的应用程序中收到以下崩溃消息。

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4321)
  at android.app.ActivityThread.access$1600 (ActivityThread.java:247)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2068)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7842)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
Caused by: android.app.ForegroundServiceStartNotAllowedException: 
  at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:54)
  at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:50)
  at android.os.Parcel.readParcelable (Parcel.java:3333)
  at android.os.Parcel.createExceptionOrNull (Parcel.java:2420)
  at android.os.Parcel.createException (Parcel.java:2409)
  at android.os.Parcel.readException (Parcel.java:2392)
  at android.os.Parcel.readException (Parcel.java:2334)
  at android.app.IActivityManager$Stub$Proxy.startService (IActivityManager.java:5971)
  at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1847)
  at android.app.ContextImpl.startForegroundService (ContextImpl.java:1823)
  at android.content.ContextWrapper.startForegroundService (ContextWrapper.java:779)
  at android.content.ContextWrapper.startForegroundService (ContextWrapper.java:779)
  at com.mypackage.appname.ui.widget.widget_package.WidgetClassName.onUpdate (WidgetClassName.java:48) …
Run Code Online (Sandbox Code Playgroud)

java service android kotlin android-studio

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

由于默认情况下禁用支持的网址,Android 深层链接无法正常工作

我的应用程序过去可以很好地使用深层链接,我没有更改应用程序中的任何内容,但似乎发生了变化的是,当新安装应用程序时,在应用程序设置中 - 设置为默认值 - 支持的网址是我的网站网址深层链接应该在默认情况下禁用的情况下工作,我必须手动启用它才能使其工作。

我怎样才能让它安装并自动启用它

android

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

如何将 Arrangement.spacedBy() 和 Arrangement.Center 组合在 Row.horizo​​ntalArrangement 中

是否可以将Arrangement.spacedBy(16.dp)and组合Arrangement.Center在一个 中Row.horizontalArrangement

我想做的是将内容水平居中并设置默认间距16.dp

我知道我可以结合Row和 aBox来达到相同的结果,但我想知道是否可以仅使用 heRow的属性来完成。

    Row(
        modifier = Modifier.fillMaxWidth(),
        horizontalArrangement = Arrangement.Center, // I would like to add the .spacedBy(16.dp), keeping the Center arrangement 
        verticalAlignment = Alignment.CenterVertically,
    ) {
        Text(
            text = stringResource(R.string.generic_error_pagination),
            style = MaterialTheme.typography.subtitle1,
            color = MaterialTheme.colors.textSecondary,
        )
        OutlinedButton(onClick = onClick) {
            Text(stringResource(id = R.string.retry_button))
        }
    }
Run Code Online (Sandbox Code Playgroud)

android android-jetpack-compose android-jetpack-compose-layout android-compose-layout

35
推荐指数
1
解决办法
6027
查看次数

如何在 .NET Maui 中创建后台服务

我是移动应用程序开发新手,正在学习 .NET Maui。我正在创建的应用程序需要侦听加速计事件,并在事件满足特定条件时向 Web 服务发送通知。我正在努力解决的问题是如何让应用程序在后台运行,即没有可见的 UI,而不进入睡眠状态,因为我希望用户完全关闭 UI。所以我认为应用程序需要作为某种服务运行,并可以选择在需要时显示 UI - 如何才能做到这一点?

android maui

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

类路径中的 flutter build Runtime JAR 文件应该具有相同的版本。这些文件在类路径中找到

类路径中的 flutter build Runtime JAR 文件应该具有相同的版本。这些文件在类路径中找到

\n

我怎么解决这个问题

\n
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)\nw: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath\nw: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)\n    C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version …
Run Code Online (Sandbox Code Playgroud)

android dart flutter

35
推荐指数
2
解决办法
3万
查看次数

删除命名空间的包名称时发生 Android 清单合并错误

根据此文档,我们不再需要在 AndroidManifest.xml 中提供包名称,而是在 build.gradle 中使用命名空间,我们可以在其中定义包名称。

package="org.sample.domain" found in source AndroidManifest.xml: C:\Users\user\Desktop\Projects\Sample\app\libs\sample\src\main\AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
Run Code Online (Sandbox Code Playgroud)

但执行此操作后,“合并清单”选项卡会显示错误,指出我没有提供包名称。我同时尝试了两者,但警告版本再次显示。

在此输入图像描述

android android-manifest android-studio android-gradle-plugin

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