React-native-fast-image: Get Error After Migrated to AndroidX

Created on 25 Jun 2019  路  4Comments  路  Source: DylanVann/react-native-fast-image

After I have migrated to AndroidX and rebuild my project then I got an error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find any version that matches androidx.legacy:legacy-support-v4:27.+.
     Versions that do not match:
       - 1.0.0
       - 1.0.0-rc02
       - 1.0.0-rc01
       - 1.0.0-beta01
       - 1.0.0-alpha3
       - + 1 more
     Required by:
         project :app > project :react-native-fast-image

Dependency versions

  • React Native version: 0.59.8
  • React version: 16.8.3
  • React Native Fast Image version: 6.0.3

Help please!

bug

Most helpful comment

@nysamnang

I had the same issue too, after a lot of searching I was able to get it to run by doing the following:

  1. Create a gradle.properties file in fast-images android folder
  2. Inside the gradle.properties add the following lines

android.useAndroidX=false
android.enableJetifier=false

  1. Build your project and it should be good!

In my case I had to do this to several libraries I'm using. Hope this helps!

All 4 comments

@nysamnang

  1. AndroidX is only going to be supported in the 0.60.0 version of react-native. Check the release candidates
  2. I saw (but cannot confirm) you wont be able to use a combination of androidx and the support library packages, (that includes your dependencies).
  3. This package doesn't have androidx support yet (its an open PR). Like many open source packages, this could take a little while to catch up with the ecosystem. Especially if your project is quite big, I would hold off on migrating to androidx until the open source community has a chance to catch up.

@nysamnang

I had the same issue too, after a lot of searching I was able to get it to run by doing the following:

  1. Create a gradle.properties file in fast-images android folder
  2. Inside the gradle.properties add the following lines

android.useAndroidX=false
android.enableJetifier=false

  1. Build your project and it should be good!

In my case I had to do this to several libraries I'm using. Hope this helps!

@granttj01 Thanks for the clarification.
@wstuckmeyer Thanks for awesome hack.
I decided roll back to Android Support Libraries instead of AndroidX, now everything is ok.

Hope this lib support AndroidX soon :)

[email protected] supports AndroidX without modifications.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jslok picture jslok  路  3Comments

StiffFy picture StiffFy  路  3Comments

kmilodenisglez picture kmilodenisglez  路  3Comments

banphlet picture banphlet  路  3Comments

NgocNamFNT picture NgocNamFNT  路  3Comments