我的cordova应用程序是非常默认的。自从我添加了第一个插件:firebase以来,它不再起作用。
我的插件列表是
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-firebase-lib 5.1.1 "Google Firebase Plugin"
cordova-plugin-whitelist 1.3.4 "Whitelist"
我相信我只需要第一个和最后一个插件,但是我尝试了其他几个插件,例如AndroidX和Android X适配器。
我仍然遇到相同的错误。
* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.3.0,17.3.0], [17.0.0,17.0.0]], but resolves to 17.3.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
我试图从platform \ android修改build.gradle(以通过com.google.android.gms的版本验证,但出现另一个错误。
这是我对build.gradle的依赖
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.1.0' // google-services dependency from cordova-plugin-firebase
classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from cordova-plugin-firebase
}
我在git,SO或youtube上看到过很多关于它的话题,但是没有一个对我有用。我还尝试通过仅输入以下内容创建新项目:
另一个有趣的事情是,由于我添加了其他插件,因此我可以阅读霓虹绿的“构建成功”字样,然后该应用进行了标准构建,然后构建失败。也许是因为cordova-plugin-firebase-lib。
非常感谢您的帮助。
据我所知,解决此错误的方法是...(我以前遇到过并以这种方式解决过。)
您需要在项目的根目录中创建一个名为build-extras.gradle的文件。
进入文件
android {
defaultConfig {
multiDexEnabled true
}
{dexoptions
javaMaxHeapSize "4g"
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
您应该添加内容。
最后在config.xml的根目录中
<platform name = "android">
+ <resource-file src = "build-extras.gradle" target = "app / build-extras.gradle" /> // You must add this
</ Platform>
希望以此方式解决。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句