Task :react-native-firebase:compileDebugJavaWithJavac FAILED
Issue
My project was working fine, i have done npm install or not sure, but suddenly its stopped working and started some error, so i have done lot of changes used jetifier , updated react native and firebase version but dont know still its giving me error My complete error
info JS server already running.
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Configuration on demand is an incubating feature.
> Configure project :app
WARNING: The following project options are deprecated and have been removed:
android.enableAapt2
This property has no effect, AAPT2 is now always used.
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Configure project :react-native-firebase
WARNING: The following project options are deprecated and have been removed:
android.enableAapt2This property has no effect, AAPT2 is now always used.
react-native-firebase: using React Native prebuilt binary from /Volumes/DATA/MYAPPS/1111/node_modules/react-native/android
> Task :app:processDebugGoogleServices
Parsing json file: /Volumes/DATA/MYAPPS/1111/android/app/google-services.json
> Task :react-native-firebase:compileDebugJavaWithJavac
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPac
kage.java:3: error: package android.support.annotation does not exist
import android.support.annotation.RequiresPermission;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.ja
va:7: error: cannot find symbol
import android.support.v4.app.NotificationManagerCompat;
^
symbol: class NotificationManagerCompat
location: package android.support.v4.app
/Volumes/DATA/MYAPPS/111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java:8: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingService.java:5: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:15: error: cannot find symbol
import android.support.v4.app.NotificationCompat;
^
symbol: class NotificationCompat
location: package android.support.v4.app
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:16: error: cannot find symbol
import android.support.v4.app.RemoteInput;
^
symbol: class RemoteInput
location: package android.support.v4.app
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:407: error: package NotificationCompat does not exist
private NotificationCompat.Action createAction(
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:494: error: cannot find symbol
private RemoteInput createRemoteInput(Bundle remoteInput) {
^
symbol: class RemoteInput
location: class DisplayNotificationTask
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseBackgroundNotificationActionReceiver.java:8: error: cannot find symbol
import android.support.v4.app.RemoteInput;
^
symbol: class RemoteInput
location: package android.support.v4.app
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:20: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:21: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotifications.java:10: error: cannot find symbol
import android.support.v4.app.RemoteInput;
^
symbol: class RemoteInput
location: package android.support.v4.app
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotifications.java:11: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/ReactNativeFirebaseAppRegistrar.java:20: error: package android.support.annotation does not exist
import android.support.annotation.Keep;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/ReactNativeFirebaseAppRegistrar.java:29: error: cannot find symbol
@Keep
^
symbol: class Keep
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java:3: error: package android.support.annotation does not exist
import android.support.annotation.RequiresPermission;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/analytics/RNFirebaseAnalyticsPackage.java:17: error: cannot find symbol
@RequiresPermission(
^
symbol: class RequiresPermission
location: class RNFirebaseAnalyticsPackage
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:370: error: cannot find symbol
@RequiresApi(api = 26)
^
symbol: class RequiresApi
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:384: error: cannot find symbol
@RequiresApi(api = 26)
^
symbol: class RequiresApi
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:398: error: cannot find symbol
@RequiresApi(api = 26)
^
symbol: class RequiresApi
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:414: error: cannot find symbol
@RequiresApi(api = 26)
^
symbol: class RequiresApi
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:457: error: cannot find symbol
@RequiresApi(api = 26)
^
symbol: class RequiresApi
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/storage/RNFirebaseStoragePackage.java:17: error: cannot find symbol
@RequiresPermission(
^
symbol: class RequiresPermission
location: class RNFirebaseStoragePackage
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.ja
va:36: error: cannot find symbol
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
^
symbol: class LocalBroadcastManager
location: class RNFirebaseMessaging
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.ja
va:36: error: cannot find symbol
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseMessaging
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessaging.java:90: error: cannot find symbol
Boolean enabled = NotificationManagerCompat
^
symbol: variable NotificationManagerCompat
location: class RNFirebaseMessaging
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingService.java:26: error: cannot find symbol
LocalBroadcastManager
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseMessagingService
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingService.java:41: error: cannot find symbol
LocalBroadcastManager
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseMessagingService
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/messaging/RNFirebaseMessagingService.java:51: error: cannot find symbol
LocalBroadcastManager
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseMessagingService
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:81: error: package NotificationCompat does not exist
NotificationCompat.Builder nb;
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:84: error: package NotificationCompat does not exist
nb = new NotificationCompat.Builder(context, channelId);
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:87: error: package NotificationCompat does not exist
nb = new NotificationCompat.Builder(context);
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:130: error: package NotificationCompat does not exist
NotificationCompat.BigPictureStyle bp = new NotificationCompat.BigPictureStyle();
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:130: error: package NotificationCompat does not exist
NotificationCompat.BigPictureStyle bp = new NotificationCompat.BigPictureStyle();
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:158: error: package NotificationCompat does not exist
NotificationCompat.BigTextStyle bt = new NotificationCompat.BigTextStyle();
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:158: error: package NotificationCompat does not exist
NotificationCompat.BigTextStyle bt = new NotificationCompat.BigTextStyle();
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:361: error: package NotificationCompat does not exist
NotificationCompat.Action action = createAction(context, a, intentClass, notification);
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:424: error: package NotificationCompat.Action does not exist
NotificationCompat.Action.Builder ab = new NotificationCompat.Action.Builder(
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:424: error: package NotificationCompat.Action does not exist
NotificationCompat.Action.Builder ab = new NotificationCompat.Action.Builder(
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:437: error: cannot find symbol
RemoteInput remoteInput = createRemoteInput(ri);
^
symbol: class RemoteInput
location: class DisplayNotificationTask
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:496: error: package RemoteInput does not exist
RemoteInput.Builder rb = new RemoteInput.Builder(resultKey);
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/DisplayNotificationTask.java:496: error: package RemoteInput does not exist
RemoteInput.Builder rb = new RemoteInput.Builder(resultKey);
^
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseBackgroundNotificationActionReceiver.java:62: error: cannot find symbol
Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
^
symbol: variable RemoteInput
location: class RNFirebaseBackgroundNotificationActionReceiver
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotificationManager.java:204: error: cannot find symbol
LocalBroadcastManager
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseNotificationManager
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotifica
tions.java:54: error: cannot find symbol
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
^
symbol: class LocalBroadcastManager
location: class RNFirebaseNotifications
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotifica
tions.java:54: error: cannot find symbol
LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(context);
^
symbol: variable LocalBroadcastManager
location: class RNFirebaseNotifications
/Volumes/DATA/MYAPPS/1111/node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/notifications/RNFirebaseNotifications.java:308: error: cannot find symbol
Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
^
symbol: variable RemoteInput
location: class RNFirebaseNotifications
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
47 errors
> Task :react-native-firebase:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-firebase:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 20s
Project Files
React Native
Click To Expand
package.json:
"react-native": "0.60.0",
"react-native-firebase": "5.5.4",
"jetifier": "^1.6.1", // added this from few suggestions
Android
Click To Expand
Have you converted to AndroidX?
- [ ] my application is an AndroidX application?
- [x] I am using
android/gradle.settingsjetifier=truefor Android compatibility? - [x] I am using the NPM package
jetifierfor react-native compatibility?
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
android/app/build.gradle:
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = true
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = true
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.application"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 30
versionName "2.1.2"
// multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk true // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-firebase')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.facebook.fresco:animated-gif:1.10.0"
implementation "com.facebook.fresco:animated-webp:1.10.0"
implementation "com.facebook.fresco:webpsupport:1.9.0"
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.8"
implementation "com.google.firebase:firebase-messaging:17.5.0"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
// implementation "com.google.firebase:firebase-config:16.0.0"
// implementation 'com.android.support:multidex:1.0.3'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
android/settings.gradle:
rootProject.name = 'myapp'
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':app'
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->
Environment
Click To Expand
react-native info output:
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 268.25 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.1.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
Android SDK:
API Levels: 19, 22, 23, 24, 25, 26, 27, 28
Build Tools: 26.0.2, 27.0.3, 28.0.2, 28.0.3
System Images: android-22 | Android TV Intel x86 Atom, android-22 | Google APIs Intel x86 Atom_64, android-28 | Android TV Intel x86 Atom, android-Q | Google APIs Intel x86 Atom
IDEs:
Xcode: 9.4/9F1027a - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.60.0 => 0.59.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-vector-icons: 4.4.0
- Platform that you're experiencing the issue on:
- [ ] iOS
- [x] Android
- [ ] iOS but have not tested behavior on Android
- [ ] Android but have not tested behavior on iOS
- [ ] Both
react-native-firebaseversion you're using that has this issue:5.5.4
Firebasemodule(s) you're using that has the issue:e.g. Instance ID
- Are you using
TypeScript?N
Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]
- 👉 Check out
React Native FirebaseandInvertaseon Twitter for updates on the library.
post the full error please - need to know failed why
@mikehardy i have updated my issue with complete error. Let me know if you need any more details
Same issue.
same issue
this is the error i've got :
error: package android.support.annotation does not exist
This looks like incorrect / partial migration to AndroidX. There's an infinite number of ways to do it wrong, the jetifier project page has the instructions on how to do it correctly plus troubleshooting for the main reasons it goes wrong. It's not really a react-native-firebase problem - it's a problem with specific projects not using AndroidX and/or managing their dependencies correctly
I am also experienced this issue (package android.support.annotation does not exist and other similar Java errors) with RN 0.60 and RNF 5.5.5 using Windows 10 + Visual Studio Code. My scenario - cfg files and errors - is almost identical to what has been shown by the OP, with the peculiar difference that I've only added the :react-native-firebase project to a vanilla react-native app made with react-native init.
From what I'm seeing - correct me if I'm wrong - there's not much to "migrate to AndroidX" anymore, since the init command (with RN 0.60) is already pulling out an AndroidX-ready app boilerplate (with android.useAndroidX and android.enableJetifier set to true), which perfectly builds and works.
The problems - in shape of Java conflicts - start as soon as you add RNF 5.5.5 and its references in the build.gradle and settings.gradle files, which I slightly modified to add the :react-native-firebase project, strictly following the official guidelines: nothing fancy, the changes to the original code are minimal, yet those few references are still enough to prevent the app from running.
As for the errors, they definitely seem to occur because the various .java files included within the /react-native-firebase/android/src/main/java/io/invertase/firebase/ folder - as shown in the OP error log - are full of Api28 references, which are not getting "Jetified" for some reasons.
I can provide additional info if you want: I can even push everyhing on GitHub, since my code is nothing more than a react-native init vanilla code with the :react-native-firebase project configured.
NOTE: switching to android.useAndroidX=false fixes all the compilation issues with the RNF 5.5.5 java files, but it breaks other .java files (RN 0.60 and other modules) that require androidx dependencies.
@Darkseal please confirm that after doing the androidx migration (useJetifier=true etc) in AndroidStudio you have also installed the jetifier npm package and run npx jetifier. If you have not done that, your build will fail
@mikehardy yes i have npx jetify in my postinstall and it fires properly.
Today I tried to fix by upgrading from 0.60.0 to 0.60.3, following the upgrade helper: the error is still the same but the offending .java class changed:
MainActivity.java:5: error: cannot access ViewGroup
public class MainActivity extends ReactActivity {
^
class file for android.view.ViewGroup not found
1 error
Any advice?
@mikehardy good news, I managed to fix that by re-creating (again) a RN 0.60.3 project from scratch and then adding RNF 5.5.5. I've yet to see what was missing, but now the app builds and run just fine.
Between us, I feel kinda boring the fact that it's nearly impossible to understand what's going on behind the hood: we're basically forced to deal with these "un-debuggable" things by reinstalling from scratch... But hey, at least it works, therefore I can't complain too much I guess :)
If anyone is interested I can publish a GitHub boilerplate with everything set up and (hopefully) working.
@Darkseal yeah - my own efforts with my real project (as opposed to constructed on-the-fly demos) has been similar - each attempt is pretty much a mess and I'm about to just do a clean 0.60.3 + v5.5.5 + jetify myself :man_shrugging: - in the end it will likely be much much cleaner anyway as my .xcodeproj has slowly become worse over time
Hello guys, thanks a lot for this discussion! So what do you suggest solution to this issue in RN 0.59.10 (RNF 5.3.1) ? Cheers
Try: https://github.com/jumpn/react-native-jetifier and: https://github.com/react-native-community/cli
I wouldn't combine those two, react-native-community/cli will begin calling jetifier directly shortly https://github.com/react-native-community/cli/pull/526
Additionally - @fcostaprojects - if you haven't been tracking jetifier changes in your package check the most recent issue - the first legitimate translation bug came in yesterday and if you're not tracking your library might be susceptible. Also there was a monorepo issue - as it's used more some interesting edge cases pop up
@mikehardy, I've removed "react-native-jetifier". App working perfectly.
Same issue, it's very difficult to create a brand new project and then add Firebase again due to the complexity and size of my project, would be greatly appreciated if this issue can be fixed quickly.
This issue destroyed my project and deadline. I mistakenly upgraded for the sake of iOS and it destroyed my android build ..
@jerryheir sorry you're having difficulties - you can see all the steps required for either RN59 or RN60 in this repo though, maybe it'll help you get straightened out: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh or https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-rn59.sh
Hi @mikehardy, I used your demo code and added firebase-messaging module to test it. Everything is fine until I send a message with firebase console ... the app is crashing ! I can see the following in adb logcat :
08-01 00:13:26.880 2576 16586 W ErrorProcessor: Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
Any Idea why ?
By the way, your demo code is awesome :)
I do not know - sorry - I specifically avoided demo of notifications / messaging until now because it is a very complicated bit of code. I had mine working at least using all the versions shown above up through RN0.59.10 but I haven't tested my RN0.60 port yet in my work app, so I can't even claim it works, though it should?
i can confirm it works on RN0.60.4 with RNF5.5.6 and RN0.60.3 with RNF5.5.5 both on debug and release.
please make sure you run npx jetify before doing ./gradlew assembleRelease to convert any android.support.v4.app.* package into androidx.core.app.*