1***@qq.com
1***@qq.com
  • 发布:2024-12-16 11:06
  • 更新:2024-12-16 12:07
  • 阅读:61

打包官方UniPlugin-Hello-AS 自定义基座报错

分类:uni-app

制作自定义调试基座,选择云端证书打Android包,总是报错,提示缺少google-services.json文件,请问怎么解决?

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:processReleaseGoogleServices'.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
[PackagePath]/app/src/release/google-services.json
[PackagePath]/app/src/google-services.json
[PackagePath]/app/src/Release/google-services.json
[PackagePath]/app/google-services.json* Try:
Run with --debug option to get more log output.
Run with --scan to get full insights.

2024-12-16 11:06 负责人:无 分享
已邀请:
DCloud_App_Array

DCloud_App_Array

使用了google推送或统计相关的库,但没有配置google-services.json文件。
如果不使用google相关功能,去掉相关依赖。如果确定使用google相关功能,从google开发者平台下载google-services.json文件并配置到项目app目录下。

  • 1***@qq.com (作者)

    如题用的是uni官网提供项目打包的,没用到google相关服务

    uniplugin_richalert

    dependencies {

    compileOnly fileTree(dir: 'libs', include: ['*.jar'])


    compileOnly 'androidx.recyclerview:recyclerview:1.0.0'  
    compileOnly 'androidx.legacy:legacy-support-v4:1.0.0'
    compileOnly 'androidx.appcompat:appcompat:1.0.0'
    compileOnly 'com.alibaba:fastjson:1.2.83'

    compileOnly fileTree(dir: '../app/libs', include: ['uniapp-v8-release.aar'])

    compileOnly 'com.alibaba:fastjson:1.1.46.android'

    }

    2024-12-16 15:10

  • DCloud_App_Array

    回复 1***@qq.com: build.gradle中是否配置已使用google的插件?

    2024-12-16 15:37

  • 1***@qq.com (作者)

    回复 DCloud_App_Array: apply plugin: 'com.android.library'

    uniplugin_richalert模块全部内容如下

    android {

    compileSdkVersion 29

    namespace 'uni.dcloud.io.uniplugin_richalert'

    defaultConfig {

    minSdkVersion 16

    targetSdkVersion 28


        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'  

    }

    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }

    }


    repositories {

    flatDir {

    dirs 'libs'

    }

    }


    dependencies {

    compileOnly fileTree(dir: 'libs', include: ['*.jar'])


    compileOnly 'androidx.recyclerview:recyclerview:1.0.0'  
    compileOnly 'androidx.legacy:legacy-support-v4:1.0.0'
    compileOnly 'androidx.appcompat:appcompat:1.0.0'
    compileOnly 'com.alibaba:fastjson:1.2.83'

    compileOnly fileTree(dir: '../app/libs', include: ['uniapp-v8-release.aar'])

    compileOnly 'com.alibaba:fastjson:1.1.46.android'

    }

    2024-12-16 16:13

  • DCloud_App_Array

    回复 1***@qq.com: 云端打包还是离线打包的?云端打包提供完整错误日志链接地址,离线打包自行检查原生工程的build.gradle配置。

    2024-12-16 17:32

  • 1***@qq.com (作者)

    回复 DCloud_App_Array: https://app.liuyingyong.cn/build/errorLog/e3c8c680-bc04-11ef-a8c1-69acdd0060b1

    2024-12-17 07:27

  • DCloud_App_Array

    回复 1***@qq.com: 从日志看是应用manifest.json勾选了unipush的fcm厂商通道,但是没有在后台配置fcm的google-services.json数据导致。如果没有配置厂商通道就不要在manifest.json中勾选fcm厂商通道。

    2024-12-17 17:55

  • 1***@qq.com (作者)

    回复 DCloud_App_Array: 去掉可以了,谢谢

    2024-12-18 15:23

  • s***@baozun.com

    回复 DCloud_App_Array: 我没有勾选Google的FCM模块也报这个错误

    2024-12-26 17:59

  • DCloud_App_Array

    回复 s***@baozun.com: 单独发帖,提供完整的云端打包错误日志链接地址。

    2024-12-27 12:21

要回复问题请先登录注册