Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: package android.support.annotation does not exist when building assembleDebug #383

Closed
martintjandra opened this issue Sep 16, 2019 · 2 comments

Comments

@martintjandra
Copy link

martintjandra commented Sep 16, 2019

Issue

I'm trying to build my react native project, which already use react native 0.60+, IDE visual studio code, and also already migrate to AndroidX. When I run ./gradlew assembleDebug, I encountered error below:

> Task :react-native-app-auth:compileDebugJavaWithJavac FAILED
/Users/martintjandra/Projects/coach-opal/node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java:10: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
/Users/martintjandra/Projects/coach-opal/node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java:11: error: cannot find symbol
import android.support.customtabs.CustomTabsCallback;
                                 ^
  symbol:   class CustomTabsCallback
  location: package android.support.customtabs
/Users/martintjandra/Projects/coach-opal/node_modules/react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java:12: error: cannot find symbol
import android.support.customtabs.CustomTabsClient;
                                 ^
  symbol:   class CustomTabsClient
  location: package android.support.customtabs
  ...
  ...

After looking around, I see that this error is caused by the project already migrated to AndroidX but the plugins in node module still don't. Some people suggest that android.support.annotation.Nullable is the way of Android plugins, not AndroidX. The AndroidX calls will be androidx.annotation.Nullable. I also read that jetifier should take care about things like this, and I also make sure that android.useAndroidX=true and
android.enableJetifier=true is present in the gradle.properties. I see in another thread #326 that the merging was on hold until RN 0.60 is released. Has it been merging yet? I see in #328 that it probably is? I already using the latest version of react-native-app-auth ^4.4.0.

How can I resolve this issue?

@dulmandakh
Copy link
Contributor

run npx jetify every time you install/update/delete NPM package. It's just work around.

codynguyen pushed a commit to codynguyen/react-native-app-auth that referenced this issue Nov 22, 2019
From https://github.com/openid/AppAuth-Android/releases

Minor bug fixes:
- Synchronizes multiple actions when requiring token refresh (FormidableLabs#332)
- Make handling of non-standard expires_at more tolerant (FormidableLabs#336)
- Changes related to Android tool changes between v25 and v27 (FormidableLabs#341, FormidableLabs#363)
- Fix encoding of client ids and secrets for auth (FormidableLabs#345)
- Handle CustomTabsSession.newSession failures (FormidableLabs#362)
- Do not automatically pass scope on token exchange request (FormidableLabs#364)
- Do not override tab title setting (FormidableLabs#365)
- Respect default browser of the user correctly (FormidableLabs#379)
- Updated custom tab definitions, including Firefox (FormidableLabs#378, FormidableLabs#383)
@kadikraman
Copy link
Contributor

kadikraman commented Jan 10, 2020

Thank you! v5 will be released today, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants