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"
               }
            }
        }
  • 相关阅读:
    「NOI2018」 你的名字
    「刷题笔记」杂题
    关于~
    「刷题笔记」网络流
    「考试」联赛模拟40-45,晚间小测4-9
    「考试」联赛模拟36-39,noip晚间小测2-3
    「刷题笔记」莫队
    「考试」CSP-S 2020
    「考试」noip模拟9,11,13
    「刷题笔记」概率与期望
  • 原文地址:https://www.cnblogs.com/mingbai/p/RNAndroidGooglyserviceWrong.html
Copyright © 2011-2022 走看看