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"
               }
            }
        }
  • 相关阅读:
    Web 应用的 UML 建模与 .NET 框架开发
    UML类详解
    学习Pythod 有感
    树形结构应用技巧
    面向对象的设计原则-类设计原则
    prototype 学习
    php framework kohana 学习2
    用批命令更新数据库
    HashTable
    jquery 调用wcf project
  • 原文地址:https://www.cnblogs.com/mingbai/p/RNAndroidGooglyserviceWrong.html
Copyright © 2011-2022 走看看