bamlab / bamlab/react-native-app-security

Android app not building properly

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
225
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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 👍

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.