react native build error: package android.support.annotation does not exist

react-native-firebase error: package android support annotation does not exist
error: package android.support.v4.content does not exist
error: package android.support.annotation does not exist androidx
error: package android.support.annotation does not exist flutter
error package org androidannotations annotations does not exist
package android support v7 app does not exist react-native
java 9 error package android support annotation does not exist
package annotation does not exist

I had to completely rewrite the question.

I have a react native android app. When I built the apk file with ./gradlew assembleRelease -x bundleReleaseJsAndAssets, it went fine, but after that it stopped compiling at all. Even react-native run-android is not working anymore.

What I found so far: First, the error is this

Task :app:processDebugResources FAILED
resource android:attr/fontVariationSettings not found.
resource android:attr/ttcIndex not found.

If I add these lines to gradle.properties,

android.useAndroidX=true
android.enableJetifier=true

the error changes. Now it's this

Task :@JWWon_react-native-universal-pedometer:compileDebugJavaWithJavac FAILED

error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
cannot find symbol
  private void sendPedometerUpdateEvent(@Nullable WritableMap params) {
                                         ^
  symbol:   class Nullable
  location: class BMDPedometerModule

The problem is not with the library though. If I remove it from the project, it start complaining about another one. To get it to compile, I have to remove 7 libraries. An example:

Task :@react-native-community_netinfo:compileDebugJavaWithJavac FAILED
error: package android.support.v4.net does not exist
import android.support.v4.net.ConnectivityManagerCompat;
error: cannot find symbol
    promise.resolve(ConnectivityManagerCompat.isActiveNetworkMetered(getConnectivityManager()));
                    ^
  symbol:   variable ConnectivityManagerCompat
  location: class ConnectivityReceiver
2 errors

then if I remove another, this happens:

Task :react-native-camera-kit:compileDebugJavaWithJavac FAILED
package android.support.annotation does not exist
import android.support.annotation.ColorInt;
                                 ^
package android.support.annotation does not exist
import android.support.annotation.IntRange;
                                 ^
...
92 errors

So it will compile if I remove 7 libraries from the project. They are:

react-native-camera-kit @react-native-community_netinfo react-native-push-notification react-native-sensors @JWWon_react-native-universal-pedometer react-native-keep-awake react-native-toast-native

Without them, it compiles perfectly. So there's a bigger problem that doesn't let it work. 2 days ago, all of those libraries were working perfectly with no problem. But now something crushes it.


allprojects {
  repositories {
      bla bla bla...
  }
  subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "26.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && !details.requested.name.contains('play-services-stats')) {
                details.useVersion "12.+"
            }
            if (details.requested.group == 'com.google.android.gms'
            && !details.requested.name.contains('multidex') && details.requested.name.contains('play-services-stats')) {
                details.useVersion "+"
            }
        }
    }
}

add subprojects in build.gradle (android)

dependencies {
     ...bla bla bla

    implementation "com.google.android.gms:play-services-gcm:12.+"
}

add implementation "com.google.android.gms:play-services-gcm:12.+" in build.gradle (android/app)

so you don't need to migrate to Androidx

edit: code format

Build Error - package android.support.annotation does not , I am upgrading from RN 0.55.3 to 0.59.8 (manually). I've got it running well on iOS, but when I run react-native run-android I'm getting the� Build Error: package android.support.annotation does not exist import android.support.annotation.Nullable #567 roshan-p opened this issue Jun 19, 2019 · 23 comments Comments


Try with jetifier

npm install --save-dev jetifier Or use yarn, but install it locally in your project, not globally

npx jetify or npx jetify -w=1 - to specify the number of parallel workers

npx react-native run-android

Build Error: package android.support.annotation does not exist , Release Android build is failed. Error. error: package android.support.v4.content does not exist [05:45:01]: ▸ import android.support� I am upgrading from RN 0.55.3 to 0.59.8 (manually). I've got it running well on iOS, but when I run react-native run-android I'm getting the following error: Task :react-native-contacts:compileDebugJavaWithJavac FAILED /node_modules/reac


I actually had something very similar happen and running this worked

npx jetify

When I ran it through the CI pipeline it didn't work and ended having to add

"scripts": {
 ...
    "postinstall": "jetify"
}

After npm runs install in the pipeline it then run jetify to convert to androidx and covers all the libraries that need to be converted.

Android release build doesn't work with react-native@0.60, error: package android.support.annotation does not exist import android. support.annotation.NonNull;. I already tried react-native unlink react-native- contacts� Build Error: package android.support.annotation does not exist import android.support.annotation.Nullable #567 Closed Sign up for free to join this conversation on GitHub .


try to use androidx

// build.gradle 
implementation "androidx.annotation:annotation:1.1.0"

// where use it
import androidx.annotation.Nullable;

UPDATE:

if other libraries error, maybe you can try jetifier, I know it by this helpful issue.

the full reference is below, hope helpful : )

// android/build.gradle
ext {
    buildToolsVersion = "28.0.3"
    minSdkVersion = 24
    compileSdkVersion = 28
    targetSdkVersion = 28
    supportLibVersion = "1.0.0-beta01"
}

// app/build.gradle
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "androidx.core:core:1.0.2"
    implementation "androidx.annotation:annotation:1.1.0"
    implementation "androidx.appcompat:appcompat:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:0.59.9"  // From node_modules
}

by the way, I meet this problem(AndroidX) for a few days, at last, solve it by update react-native@0.59.9, use the latest android setting and the magic jetifier.

Build Error - package android.support.annotation does , error: package android.support.v7.app does not exist error cannot find symbol: class nullable react-native error: package notificationcompat does not exist Stack Overflow Public questions and answers; Teams Private questions and answers for your team; Enterprise Private self-hosted questions and answers for your enterprise; Talent Hire technical talent


add

android.useAndroidX=true
android.enableJetifier=true

in gradle.properties

error: package com.android.annotations does not exist, So what does that mean for your React Native project ? error: package android. support.annotation does not existimport We don't build our apks manually, we use AppCenter to do that, so already that's a blocker. .annotation does not exist import android.support.annotation.UiThread; ^ C:\Users\REVO-WISSE\Documents\customer_master\app\build\generated\source\apt\debug\com\fundi\passenger\mMassage\LocationPickerActivity_ViewBinding.java:4: error: package android.support.annotation does not exist import android.support.annotation.CallSuper; ^


React Native — How to handle an app with both pre-AndroidX and , error: package android.support.annotation does not exist This is my build. gradle node_modules/react-native-unimodules/gradle.groovy"� error: package android.support.annotation does not exist error: package android.support.v4.content does not exist error: cannot find symbol variable LocalBroadcastManager error: cannot find symbol class RemoteInput error: package android.support.v4.content does not exist error: cannot find symbol class LocalBroadcastManager


ExpoKit 33, I hope you faced the problem of not making an Android build or NOTE: Do not place your application dependencies here; they the error it looks something like android.support.annotation.nullable package com.rnfs; For newer versions of react-native support v4 is replaced with androidx ,Add this at end of your app level build.gradle If you had similar problem with other libraries you have to replace them like this


(React Native) Android studio not making Build on the new release , I can't build the Android apk due to this error from sentry-react-native (0.43.2) on Android : package android.support.annotation does not exist. Home » Android » react native – error: package com.android.annotations does not exist react native – error: package com.android.annotations does not exist Posted by: admin April 10, 2020 Leave a comment