react-native-app-security icon indicating copy to clipboard operation
react-native-app-security copied to clipboard

Android app not building properly

Open Nesh108 opened this issue 3 months ago • 0 comments

Hello, thanks for the great package!

I have tried using it on Expo 50 and I got:

* What went wrong:
A problem occurred evaluating project ':bam-tech-react-native-app-security'.
> Failed to apply plugin class 'KotlinExpoModulesCorePlugin'.
   > Could not find method android() for arguments [KotlinExpoModulesCorePlugin$_apply_closure4@4db431f8] on project ':bam-tech-react-native-app-security' of type org.gradle.api.Project.

Looking at build.gradle, I made this change:

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

// --- MOVED THE EXPO PLUGIN APPLICATION HERE ---
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
if (expoModulesCorePlugin.exists()) {
  apply from: expoModulesCorePlugin
  applyKotlinExpoModulesCorePlugin()
}
// ---------------------------------------------

group = 'tech.bam.rnas'
version = '0.1.0'

buildscript {
  // --- REMOVED THE "apply from" FROM INSIDE THIS BLOCK ---

  // Simple helper that allows the root project to override versions declared by this library.
  ext.safeExtGet = { prop, fallback ->
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  }

  // Ensures backward compatibility
  ext.getKotlinVersion = {
    if (ext.has("kotlinVersion")) {
      ext.kotlinVersion()
    } else {
      ext.safeExtGet("kotlinVersion", "1.8.10")
    }
  }
...

That allowed me to build it properly. Just wanted to report it 👍

Nesh108 avatar Oct 21 '25 19:10 Nesh108