Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
143 views
in Technique[技术] by (71.8m points)

java - What can break an android build without code changes?

I am working on a react-native app that uses react-native-firebase. I've setup a CI build on travis with the aim to have reproducible builds, and it has suddenly stopped working, as detailed here:

  • before: 4 days ago, the build works
  • after: today, the exact same build is broken, failing with the following message:

Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (16.0.1) and runtime (17.0.0) classpath. You should manually set the same version via DependencyResolution

My only reasonable guess is that some dependency has changed, but I don't understand android builds well enough to figure out what has happened or why.

And obviously, how do I prevent such surprises from happening in the future? (in my mind, this build should be perfectly repeatable)

As a side note, when the build fails, it also shows several warnings like:

WARNING: Conflict with dependency 'com.google.android.gms:play-services-base' in project ':app'. Resolved versions for runtime classpath (17.0.0) and compile classpath (16.0.1) differ. This can lead to runtime crashes. To resolve this issue follow advice at https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties. Alternatively, you can try to fix the problem by adding this snippet to /home/travis/build/mapswipe/mapswipe/android/app/build.gradle: dependencies { implementation("com.google.android.gms:play-services-base:17.0.0") }

but following that advice only causes further (different) errors.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The root cause is related migration to Androidx, google play service updated to androidX

If you are using real-native-info, please upgrade. It will solve your problem with 2.1.2

See here apply link

Note: Upgrading com.google.android.gms to 17.0.0 will cause many problems.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...