question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lateinit property _buildFeatureValues has not been initialized

See original GitHub issue

Description

Getting lateinit property _buildFeatureValues has not been initialized when trying to build on android.

Version

0.70.6

Output of npx react-native info

System: OS: macOS 11.3.1 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Memory: 89.78 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.0 - /usr/local/bin/node Yarn: 1.22.19 - npm: 8.19.1 - /usr/local/bin/npm Watchman: 2022.09.19.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 11.0.13 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

upgrade RN project from 0.67 to 0.70.xx

Snack, code example, screenshot, or link to a repository

distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists

dependencies {
    classpath("com.android.tools.build:gradle:7.3.1")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("de.undercouch:gradle-download-task:5.0.1")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21")
    classpath("com.google.gms:google-services:4.3.10")
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cortinicocommented, Dec 5, 2022

The issue you’re having is because you depend on https://github.com/OneSignal/OneSignal-Gradle-Plugin which is deprecated.

You should follow the instructions provided by OneSignal to clean this up and not use the OneSignal Gradle Plugin anymore. Specifically the line:

classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'

is creating this build failure for you

0reactions
hugoh59commented, Dec 5, 2022

Thank you! Removing the old code for the react-native-onesignal inside build.graddle file did fix the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

lateinit property _buildFeatureValues has not been initialized ...
When I Upgrade Gradle from 4.2.2 to 7.3.0 I got Below Error. Cause: lateinit property _buildFeatureValues ...
Read more >
lateinit property _buildFeatureValues has not been initialized
When I want to convert a Kotlin library to Android library, I am getting this error. I only changed gradle of domain module....
Read more >
lateinit Property in Kotlin - Suneet Agrawal
There can be two ways to declare and initialize a var property. ... identifies the property being accessed and the fact that it...
Read more >
Initializing lazy and lateinit variables in Kotlin - LogRocket Blog
... lateinit property is accessed, Kotlin provides it a null value under the hood to indicate that the property has not been initialized...
Read more >
A practical explanation for initialization modifiers in Kotlin
UninitializedPropertyAccessException : lateinit property myVar has not been initialized. Ah! And some more details at the top: lateinit does not work with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found