Skip to content

Latest commit

 

History

History
112 lines (86 loc) · 3.09 KB

File metadata and controls

112 lines (86 loc) · 3.09 KB

GNSS Library Upgrade Guide

JVM Target 17 Compatibility Update (v1.1.0)

This version updates the library to support JVM target 17, resolving compatibility issues with modern React Native and Android development environments.

What's Changed

✅ Upgraded Components

  • JVM Target: Updated from 11 to 17
  • Android Gradle Plugin: Updated to 8.0.2
  • Kotlin Plugin: Updated to 1.9.22
  • Compile SDK: Updated to 34
  • Target SDK: Updated to 34
  • React Native: Updated to 0.73.0

🔧 Quick Fix for Users (Temporary)

If you're experiencing build issues while waiting for this update, add this to your project's android/build.gradle (in the root of your React Native project):

// Add this at the bottom of your android/build.gradle file
subprojects {
    afterEvaluate { project ->
        if (project.hasProperty('android')) {
            android {
                compileOptions {
                    sourceCompatibility JavaVersion.VERSION_17
                    targetCompatibility JavaVersion.VERSION_17
                }
            }
        }
        if (project.hasProperty('kotlin')) {
            tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
                kotlinOptions {
                    jvmTarget = "17"
                }
            }
        }
    }
}

📱 Installation

Update to the latest version:

npm install react-native-gnss-status-checker@latest
# or
yarn add react-native-gnss-status-checker@latest

🏗️ Build Requirements

Make sure your development environment supports:

  • Java: JDK 17 or higher
  • Android Gradle Plugin: 8.0.0 or higher
  • Kotlin: 1.8.0 or higher
  • React Native: 0.70.0 or higher

🚨 Breaking Changes

This update should be backward compatible, but if you encounter issues:

  1. Clean your build:

    cd android && ./gradlew clean && cd ..
    npx react-native run-android
  2. Update your Android project:

    • Ensure your main android/build.gradle uses Android Gradle Plugin 8.0+
    • Set JVM target to 17 in your app's android/app/build.gradle
  3. Check Java version:

    java -version
    # Should show version 17 or higher

📋 Verification

After updating, verify the installation:

import { GnssStatusChecker } from 'react-native-gnss-status-checker';

// Check if everything works
GnssStatusChecker.getGNSSStatus()
  .then(status => {
    console.log('GNSS Status:', status);
    console.log('API Level:', status.apiLevel);
    console.log('Supports CN0:', status.supportsCn0);
  })
  .catch(error => {
    console.error('Error:', error);
  });

🆘 Support

If you encounter issues after upgrading:

  1. Check that your Android environment supports JDK 17
  2. Clean and rebuild your project
  3. Verify React Native version compatibility
  4. Open an issue on GitHub

📝 Migration from v1.0.x

No code changes required - this is purely an infrastructure update for better compatibility with modern development environments.