Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28463

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

$
0
0

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.


Viewing all articles
Browse latest Browse all 28463

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>