2

I tried most the answers provided in stackoverflow as well as github from adding

multiDexEnabled true 
dexOptions{javaMaxHeapSize "4g"} 

but there was no luck, I think my problem is with the dependencies. The actual error I am getting when I run cd android ./gradlew clean then gradlew assembldebug or react-native run-android is

What went wrong: Execution failed for task':app:transformClassesWithMultidexlistForDebug'. com.android.build.api.transform.TransformException: Error while generating the main dex list.

Building in Android Studio shows the following Error:

Program type already present: androidx.versionedparcelable.CustomVersionedParcelable

adding

android.useAndroidX=true
android.enableJetifier=true

causes more problems since most of my react-native libraries that I used in my project not translated to androidx

Execution failed for task ':react-native-navigation:compileReactNative57_5DebugJavaWithJavac'

so my intention is to draw back from androidx, is there a way to do so?

Ahmed Imam
  • 1,315
  • 2
  • 19
  • 42
  • can you provide error log, and as you fail in assembldebug can you install that,bear in mind that using debug build in react will give users access ti devMenu – nima moradi Jun 21 '19 at 16:02
  • I just did provided the error above plz check, thanks – Ahmed Imam Jun 21 '19 at 16:04
  • no provide complete log, another good practice is using android studio which give more hint – nima moradi Jun 21 '19 at 16:19
  • Android Studio gives this Error . Program type already present: androidx.versionedparcelable.CustomVersionedParcelable – Ahmed Imam Jun 21 '19 at 16:34
  • Possible duplicate of [Error: "Program type already present: androidx.versionedparcelable.CustomVersionedParcelable"](https://stackoverflow.com/questions/53570454/error-program-type-already-present-androidx-versionedparcelable-customversion) – nima moradi Jun 22 '19 at 15:43
  • please read my comment to your answer] – Ahmed Imam Jun 22 '19 at 15:49

1 Answers1

1

After a day of research, couldn't find a correct way to roll back from androidx and translating all react-native dependencies to androidx manually seems a tedious job but thanks to this library jetifier I was able to do so just by running

npm i --save-dev jetifier
npx jetify
Ahmed Imam
  • 1,315
  • 2
  • 19
  • 42