react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.76k stars 466 forks source link

Compilation error with next storage #577

Closed vtoupet closed 3 years ago

vtoupet commented 3 years ago

Current behavior

After upgrading to version 1.15.1, I wanted to use next storage for Android. I get a compilation error even though I followed instructions (project builde.gradle + app build.gradle + gradle.properties)

> Task :react-native-community_cameraroll:compileReleaseJavaWithJavac
Note: /Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-async-storage_async-storage:kaptReleaseKotlin
/Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/build/tmp/kapt3/stubs/release/com/reactnativecommunity/asyncstorage/next/StorageDb.java:7: warning: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
public abstract class StorageDb extends androidx.room.RoomDatabase {
                ^[WARN] Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor (DYNAMIC).

> Task :react-native-async-storage_async-storage:compileReleaseKotlin
w: /Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/ArgumentHelpers.kt: (41, 17): Unchecked cast: ArrayList<Any!> to List<String>
w: /Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt: (60, 69): Type mismatch: inferred type is String? but String was expected

> Task :react-native-async-storage_async-storage:compileReleaseJavaWithJavac FAILED
/Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/build/generated/source/kapt/release/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java:23: error: cannot find symbol
import javax.annotation.Generated;
                       ^
  symbol:   class Generated
  location: package javax.annotation
/Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/build/generated/source/kapt/release/com/reactnativecommunity/asyncstorage/next/StorageDb_Impl.java:25: error: cannot find symbol
@Generated("androidx.room.RoomProcessor")
 ^
  symbol: class Generated
/Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/build/generated/source/kapt/release/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java:23: error: cannot find symbol
import javax.annotation.Generated;
                       ^
  symbol:   class Generated
  location: package javax.annotation
/Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/build/generated/source/kapt/release/com/reactnativecommunity/asyncstorage/next/StorageDao_Impl.java:28: error: cannot find symbol
@Generated("androidx.room.RoomProcessor")
 ^
  symbol: class Generated
Note: /Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/vincent/Documents/workspace/better_weather/mobile/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-async-storage_async-storage:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Expected behavior

No error during compilation

Environment

vtoupet commented 3 years ago

Problem was my version of Java JDK (I was using JDK 10). I upgraded to JDK 15 and problem disappeared.