小编Mar*_*ler的帖子

访问被拒绝查找属性"camera.hal1.packagelist"

在服务中使用相机时,移动屏幕变得不可触摸(由透明窗口锁定)并且仅在出现错误之下

Access denied finding property "camera.hal1.packagelist"
Run Code Online (Sandbox Code Playgroud)

将是什么原因及其解决方案?请帮忙..

android android-service android-camera android-camera2

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

FirebaseCloudMessaging:FirebaseInstanceId后台同步失败 - SERVICE_NOT_AVAILABLE

我在Android中使用Firebase云消息传递(FCM)API进行推送通知.当我实施那个时间完美的工作,但现在它找不到谷歌播放的服务.

错误是:

FirebaseInstanceId:后台同步失败:SERVICE_NOT_AVAILABLE,

请帮我解决一下.我在gradle文件中使用了以下依赖项.

dependencies {
    compile files('libs/ksoap2-android-assembly-3.4.0-jar.jar')
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/activation.jar')
    compile files('libs/mail.jar')
    compile files('libs/additionnal.jar')
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.facebook.android:facebook-android-sdk:4.14.0'
    compile 'com.google.firebase:firebase-messaging:9.0.2'

    compile('com.google.android.gms:play-services:9.0.2') {
        exclude group: "play-services-wallet"
        exclude module: "play-services-wallet"
        exclude group: "play-services-ads"
        exclude module: "play-services-ads"
    }

}
Run Code Online (Sandbox Code Playgroud)

感谢您抽时间阅读.

android firebase firebase-cloud-messaging

26
推荐指数
6
解决办法
4万
查看次数

MobileAds.initialize(Context, String) 已弃用

在它看起来像这样之前(通过R.string.admob_application_id):

MobileAds.initialize(this, getString(R.string.admob_application_id));
Run Code Online (Sandbox Code Playgroud)

MobileAds方法.initialize(Context context, String applicationCode) 现在是:

此方法已弃用。使用initialize(Context, OnInitializationCompleteListener)来代替。

其中写道:

初始化 Google 移动广告 SDK。尽早调用此方法以减少会话第一个广告请求的延迟。如果未调用此方法,第一个广告请求会自动初始化 Google 移动广告 SDK。

MobileAds.Settings也已弃用。


到目前为止我尝试过的是获取InitializationStatus每个适配器:

MobileAds.initialize(this, initializationStatus -> {

    /* get the adapter status */
    Map<String, AdapterStatus> map = initializationStatus.getAdapterStatusMap();
    for (Map.Entry<String, AdapterStatus> entry : map.entrySet()) {
        AdapterStatus adapterStatus = entry.getValue();
        AdapterStatus.State state = adapterStatus.getInitializationState();
        Log.d(LOG_TAG, "key = " + entry.getKey() + ", state = " + state.name() + ", desc = " + adapterStatus.getDescription());
    } …
Run Code Online (Sandbox Code Playgroud)

java android admob deprecation-warning

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

variantOutput.getPackageApplication()已过时

随着Gradle 4.10.1和Android Gradle插件的更新3.3.0,我得到以下警告:

警告:API' variantOutput.getPackageApplication()'已过时,已替换为' variant.getPackageApplicationProvider()'.

该行,与周围的上下文(由构建变量分配输出文件名):

applicationVariants.all { variant ->
    variant.outputs.all { output ->

        if (variant.getBuildType().getName() in rootProject.archiveBuildTypes) {

            def buildType = variant.getBuildType().getName()
            if (variant.versionName != null) {

                def baseName = output.baseName.toLowerCase()
                String fileName = "${rootProject.name}_${variant.versionName}-${baseName}.apk"

                // this is the line:
                outputFileName = new File(output.outputFile.parent, fileName).getName()
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

迁移指南是不是太有帮助; 虽然variant.outputs.all可能有问题 - 只是不知道要替换什么 - 并且迁移指南指的是任务而不是构建变体.禁用时File ? Settings ? Experimental ? Gradle ? Only sync the active variant,我会得到更多的弃用警告(重点是,这些方法都没有被直接调用): …

gradle build.gradle android-gradle-plugin deprecation-warning build-variant

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

使用adb shell连接到wi-fi

我有连接到特定接入点的所有细节.我只能使用该访问点,所以我需要的是执行它的命令.

linux android adb

23
推荐指数
4
解决办法
7万
查看次数

Android Material Design 示例代码给出缺少资源错误

我正在尝试运行 Android 材料设计,同样取自下面https://github.com/material-components/material-components-android

但出现这些错误:

failed
:lib:packageDebugResources
tokens.xml
Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_color_dark_surface_tint">?attr/colorPrimary</macro>'
fab_tokens.xml
Can't determine type for tag '<macro name="m3_comp_fab_primary_container_color">?attr/colorPrimaryContainer</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_comp_switch_selected_icon_color">?attr/colorOnPrimaryContainer</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_motion_path">linear</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_sys_shape_corner_full_family">rounded</macro>'
tokens.xml
Can't determine type for tag '<macro name="m3_ref_typeface_brand_regular">sans-serif</macro>'
/Users/mac/AndroidStudioProjects/material-components-android/lib/java/com/google/android/material/bottomappbar/res/values/tokens.xml: Error: Can't determine type for tag '<macro name="m3_comp_bottom_app_bar_container_color">?attr/colorSurface</macro>'
Run Code Online (Sandbox Code Playgroud)

android android-studio material3

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

如何使用Gradle更改应用程序包的生成文件名?

因此,要在gradle android中更改生成的APK文件名,我可以执行以下操作:

applicationVariants.output.all {
    outputFileName = "the_file_name_that_i_want.apk"
}
Run Code Online (Sandbox Code Playgroud)

生成的App Bundle文件有类似的东西吗?如何更改生成的App Bundle文件名?

android gradle android-gradle-plugin android-app-bundle

16
推荐指数
5
解决办法
4216
查看次数

META-INF/versions/9/module-info.class:类文件损坏?(此功能需要 ASM6)

我在使用 Bouncycastle 时遇到了问题,这仅在运行:lint任务时出现。

通常它似乎是 Java 9 字节码版本 53.0 / ASM版本冲突。

这些是依赖项:

// https://mvnrepository.com/artifact/org.bouncycastle
implementation "org.bouncycastle:bcprov-jdk15on:1.64"
implementation "org.bouncycastle:bcpkix-jdk15on:1.64"
Run Code Online (Sandbox Code Playgroud)

这导致:lint任务抛出处理错误:

> Task :mobile:lint
Error processing bcpkix-jdk15on-1.64.jar:META-INF/versions/9/module-info.class: broken class file? (This feature requires ASM6)
Error processing bcprov-jdk15on-1.64.jar:META-INF/versions/9/module-info.class: broken class file? (This feature requires ASM6)
Run Code Online (Sandbox Code Playgroud)

META-INF/versions/9/module-info.class:类文件损坏?(此功能需要 ASM6)

这同样适用于:

// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation "com.google.code.gson:gson:2.8.6"
Run Code Online (Sandbox Code Playgroud)

自从升级1.4.11.4.2-native-mt,它又是一样的:

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2-native-mt"
Run Code Online (Sandbox Code Playgroud)

kotlin-stdlib-1.4.0.jar:META-INF\versions\9\module-info.class:类文件损坏?(模块需要 ASM6)

java android bouncycastle gson android-lint

16
推荐指数
2
解决办法
8319
查看次数

Firebase 函数本地“文件:”依赖项

我正在使用react-crud-shared作为使用Firebase Cloud Functions 的react-crud-backend 的依赖项。

react-crud-backend我有以下内容:

{
  "name": "react-crud-backend",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    ...
  },
  "dependencies": {
    ...
    "react-crud-shared": "file:../shared",
    ...
  },
  "engines": {
    "node": "8"
  },
  "private": true,
  "devDependencies": {
    ...
  }
}
Run Code Online (Sandbox Code Playgroud)

react-crud-shared我有以下内容:

{
  "name": "react-crud-shared",
  "version": "0.0.1",
  "description": "",
  "main": "src/index.js",
  "private": true,
  "dependencies": {
    "lodash": "^4.17.11"
  }
}
Run Code Online (Sandbox Code Playgroud)

它在开发中运行良好:“firebase serve --only functions”,但在部署时会引发错误:

Did you list all required modules in the package.json dependencies?
Detailed stack …
Run Code Online (Sandbox Code Playgroud)

npm firebase google-cloud-functions

15
推荐指数
1
解决办法
2978
查看次数

Android Room Kotlin 抛出删除查询错误

我正在尝试使用 Android Room 2.3.0,目前遇到以下编译错误:

项目道:

error: Not sure how to handle query method's return type (java.lang.Object). DELETE query methods must either return void or int (the number of deleted rows).
    public abstract java.lang.Object deleteAllProjects(@org.jetbrains.annotations.NotNull()
error: Query method parameters should either be a type that can be converted into a database column or a List / Array that contains such type. You can consider adding a Type Adapter for this.
    kotlin.coroutines.Continuation<? super kotlin.Unit> continuation);
error: Unused parameter: continuation
    public abstract java.lang.Object …
Run Code Online (Sandbox Code Playgroud)

android kotlin android-room

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