zoukankan      html  css  js  c++  java
  • Build fails with an error: Execution failed for task ':react-native-google-analytics-bridge:compileDebugJavaWithJavac'.

    1,问题

    Build fails with an error:
    Execution failed for task ':react-native-google-analytics-bridge:compileDebugJavaWithJavac'.  
    
       package com.google.android.gms.tagmanager does not exist
    import com.google.android.gms.tagmanager.TagManager;  
    

    RN android 突然报错,浏览查阅一大堆无果,隔了两天,又查了一下,找到一个解决方案 。
    这个问题,是由于google play services 更新,并且自己代码又用‘+’指定的 版本号导致的。更新之后类不在原来的地方了,所以报缺失包的错。

    2,解决

    在 android/build.gradle里添加下面,start 和end 之间的代码,完美的解决了这个问题。

    allprojects {
               repositories {
               //start here
           configurations.all {
            resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
                if (requested.group == 'com.google.android.gms') {
                   details.useVersion '12.0.1'
                }
                 if (requested.group == 'com.google.firebase') {
                    details.useVersion '12.0.1'
                  }
                }
              }
         //end
          jcenter()
               maven {
                url "https://maven.google.com"
               }
            }
        }
  • 相关阅读:
    Listener:监听器
    go语言基础数据类型
    Envoy基于文件系统的RDS动态配置
    git常用操作
    c语言 assert(转)
    浅谈可重入函数与不可重入函数【转】
    静态全局变量和全局变量的区别(转)
    c语言 排序(转)
    c语言刷 队列题记录
    c语言刷 链表题记录
  • 原文地址:https://www.cnblogs.com/mingbai/p/RNAndroidGooglyserviceWrong.html
Copyright © 2011-2022 走看看