React-native-reanimated: support for androidx

Created on 23 Aug 2019  路  11Comments  路  Source: software-mansion/react-native-reanimated

transitions is throwing error in react-native 0.60.5
@kmagiera

Most helpful comment

@robonaut quick fix for this issue,

//need to remove once library updates to androidx
preBuild.doFirst {
    ant.replaceregexp(match: 'android.support.annotation.NonNull;', replace: 'androidx.annotation.NonNull;', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
    ant.replaceregexp(match: 'android.support.annotation.Nullable;', replace: 'androidx.annotation.Nullable;', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
    ant.replaceregexp(match: 'android.support.transition', replace: 'androidx.transition', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
}

Add this before dependencies in android/app/build.gradle

All 11 comments

Same here

@robonaut quick fix for this issue,

//need to remove once library updates to androidx
preBuild.doFirst {
    ant.replaceregexp(match: 'android.support.annotation.NonNull;', replace: 'androidx.annotation.NonNull;', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
    ant.replaceregexp(match: 'android.support.annotation.Nullable;', replace: 'androidx.annotation.Nullable;', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
    ant.replaceregexp(match: 'android.support.transition', replace: 'androidx.transition', flags: 'g', byline: true)
            {
                fileset(dir: '../../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/', includes: '*.java')
            }
}

Add this before dependencies in android/app/build.gradle

thanks, you saved hours of my life @ashrithks !

I had error in my app (just to let other people know how to fix that)

.../node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/transitions/TransitionModule.java:3: error: package android.support.transition does not exist
import android.support.transition.TransitionManager;

@denieler +1

@denieler +1锛泃his problem is 'package android.support.transition does not exist'. @kmagiera

reanimated/transitions/TransitionModule.java:3: error: package androidx.transition does not exist
import androidx.transition.TransitionManager;
                          ^

Used jetify to patch to androidx. But is there any additional libs to be added to gradle?

Created a PR https://github.com/kmagiera/react-native-reanimated/pull/395.

Workaround: run npx jetify every time you install/update/remove NPM package.

Created a PR #395.

Workaround: run npx jetify every time you install/update/remove NPM package.

amazing workaround 馃憤 ...

Closing this as of #395

I got a solution

Upgrade react-native-reanimated to ^1.5.0 without touching any part of your android config

I got a solution

Upgrade react-native-reanimated to ^1.5.0 without touching any part of your android config

Works like a charm. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zxccvvv picture zxccvvv  路  3Comments

levibuzolic picture levibuzolic  路  3Comments

colinux picture colinux  路  3Comments

wasim-abuzaher picture wasim-abuzaher  路  3Comments

bjartebore picture bjartebore  路  3Comments