mieszko4 / react-native-zoom-us

MIT License
126 stars 118 forks source link

[Android] local variable intent is accessed from within inner class #227

Closed amdrade closed 2 years ago

amdrade commented 2 years ago

Hi, version: react-native-zoom-us: 6.14.0 react-native: 0.62.2

yarn run android return error:

\node_modules\react-native-zoom-us\android\src\main\java\ch\milosz\reactnative\RNZoomUsModule.java:97: error: local variable intent is accessed from within inner class; needs to be declared final startZoomScreenShare(intent);

mieszko4 commented 2 years ago

It builds for me (https://github.com/mieszko4/react-native-zoom-us-test) for Android 9. Perhaps you are using different version of gradle? Also, feel free to open a PR.

amdrade commented 2 years ago

That could be it then i'll check it out, thanks! my verison: classpath("com.android.tools.build:gradle:3.6.4")

amdrade commented 2 years ago

update gradle gradle => 4.2.2 file android\build.gradle gradle-wrapper => 6.7.1 file android\gradle\wrapper\gradle-wrapper.properties

solve!

amdrade commented 2 years ago

After update gradle and generate signed buid: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0. :(

mieszko4 commented 2 years ago

:thinking: Not sure why you are having this problem but it does not seem like an issue related to this lib because it does not use kotlin.

skychavda commented 2 years ago

@amdrade I facing the same error how you resolved it?

Can you post your solution here?

amdrade commented 2 years ago

@amdrade I facing the same error how you resolved it?

Can you post your solution here?

hello @skychavda I followed the IDE's suggestions and changed the code directly, adding the final modifier to the variables that had the error.

@ReactMethod public void initialize(final ReadableMap params, final ReadableMap settings, final Promise promise) { UiThreadUtil.runOnUiThread(new Runnable() {