You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have updated from 2.02 to 2.1.0 while also enabling the new architecture on our app and we are facing an error when building android
> Task :app:compileDebugKotlin FAILED
MainApplication.kt:23:12 Unresolved reference: iterable
MainApplication.kt:55:5 Unresolved reference: IterableApi
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
These lines (IterableApi.setContext(this) were added following Iterable's docs guidance, and it was working until we made this upgrade to 2.1.0
What I've tried so far
I tried to remove those lines as I did not see them in the example project, and although that made the build pass, when the app was opened I am now seeing this
Thanks for reporting this. This is likely due to old build artifacts still being present. Cleaning Android then rebuilding should fix this issue:
cd android
./gradlew clean
Also, please make sure that:
You are on the correct node version (v20.19.0)
The correct variables are exposed in your .zshrc or .bash_profile. EG: JAVA_HOME, ANDROID_HOME, etc. See the react native docs for more details.
Regarding IterableApi.setContext(this) -- that definitely should be in your app, and is an oversight in our example application. Thanks for pointing it out! We will create a ticket for adding this into our example app.
Please let me know if you have any further issues.
Thanks for your reply. Unfortunately cleaning did not fix the issue, I tried your suggestion and I also tried:
cd android
rm -rf .gradle build app/build app/.cxx
./gradlew clean
We're currently on node version v24.12.0, this is a requirement by another third party sdk we use, so it is not an option to downgrade right now.
I was able to find a workaround by manually linking the library using react-native.config.js:
constpath=require('path');module.exports={dependencies: {'react-native-vector-icons': {platforms: {ios: null,},},// Lines below fixed the issue'@iterable/react-native-sdk': {platforms: {android: {sourceDir: path.join(__dirname,'node_modules/@iterable/react-native-sdk/android',),/* These manual configurations are required because autolinking fails to parse the package information from the source files due to the non-standard file structure of this library. */packageImportPath:
'import com.iterable.reactnative.RNIterableAPIPackage;',packageInstance: 'new RNIterableAPIPackage()',libraryName: 'RNIterableAPISpec',componentDescriptors: [],cmakeListsPath: path.join(__dirname,'node_modules/@iterable/react-native-sdk/android/build/generated/source/codegen/jni/CMakeLists.txt',),},},},},};
Looks like autolinking is failing in our project and having this works for now. Given this is not a permanent fix because of its hacky nature, I would like to know if there's a better way to troubleshoot autolinking not working in our project
Activity
lposen commentedon Jan 9, 2026
Hi @miarevalo10,
Thanks for reporting this. This is likely due to old build artifacts still being present. Cleaning Android then rebuilding should fix this issue:
cd android ./gradlew cleanAlso, please make sure that:
JAVA_HOME,ANDROID_HOME, etc. See the react native docs for more details.Regarding
IterableApi.setContext(this)-- that definitely should be in your app, and is an oversight in our example application. Thanks for pointing it out! We will create a ticket for adding this into our example app.Please let me know if you have any further issues.
miarevalo10 commentedon Jan 13, 2026
Hi @lposen
Thanks for your reply. Unfortunately cleaning did not fix the issue, I tried your suggestion and I also tried:
We're currently on node version
v24.12.0, this is a requirement by another third party sdk we use, so it is not an option to downgrade right now.I was able to find a workaround by manually linking the library using react-native.config.js:
Looks like autolinking is failing in our project and having this works for now. Given this is not a permanent fix because of its hacky nature, I would like to know if there's a better way to troubleshoot autolinking not working in our project
Thanks in advance
lposen commentedon Jan 16, 2026
Hi @miarevalo10,
Sorry that you're experiencing these issues.
What version of React Native are you using?
miarevalo10 commentedon Jan 16, 2026
Hi @lposen
We're currently using :
#793 Fix Android unresolved IterableApi reference
fix: auto-set IterableApi context in RN module initialization (Iterab…