Comments (17)
I was getting the same error actually now. The module itself is pretty outdated. Last updates in 2017 😅 i have gotten it to work btw locally. Just need to fix something in open-native after which i will post the steps here to follow.
from open-native.
Hey, so follow the steps below once I release alpha.15:
Install the module from here:
npm install @hkpuits/react-native-beacons-manager
Add the following patch in patches/@hkpuits+react-native-beacons-manager+1.2.7.patch
. Use patch-package to install the patch. Mainly you need to add postinstall:"patch-package"
in scripts
inside package.json
.
diff --git a/node_modules/@hkpuits/react-native-beacons-manager/android/src/main/AndroidManifest.xml b/node_modules/@hkpuits/react-native-beacons-manager/android/src/main/AndroidManifest.xml
index a7e2244..f186903 100755
--- a/node_modules/@hkpuits/react-native-beacons-manager/android/src/main/AndroidManifest.xml
+++ b/node_modules/@hkpuits/react-native-beacons-manager/android/src/main/AndroidManifest.xml
@@ -8,9 +8,9 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application>
- <service android:name="com.mackentoch.beaconsandroid.BeaconsAndroidTransitionService"/>
+ <service android:exported="true" android:name="com.mackentoch.beaconsandroid.BeaconsAndroidTransitionService"/>
- <receiver android:name="com.mackentoch.beaconsandroid.BeaconsAndroidBootReceiver">
+ <receiver android:exported="true" android:name="com.mackentoch.beaconsandroid.BeaconsAndroidBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
In nativescript.config.js
:
export default {
...
'open-native': {
patchAndroidApplication: true,
},
} as NativeScriptConfig;
Run the app & it should build normally. This will work in alpha.15 that I will release in a bit.
from open-native.
Hey @Atomico001 alpha.16 is out. Please follow the updated setup guide for android: https://github.com/OpenNative/open-native/tree/main/packages/core
Then do the above mentioned steps to get it to build with the module installed.
from open-native.
Perfect. i will try. Thank you for you effort!
from open-native.
@Atomico001 What react native plugin are you using? can you pass the link? Thank you!
from open-native.
@vallemar Thank you for answer
At this moment i installed only the open-native plugin followed the guide in this github Readme.
But i receive that error.
The final goal is to install https://github.com/MacKentoch/react-native-beacons-manager
from open-native.
Hey @Atomico001 Can you share your before-plugins.gradle
file?
from open-native.
Hey @Atomico001 Can you share your
before-plugins.gradle
file?
ext {
// The version used here should be same as the one's
// set in app.gradle file.
buildToolsVersion = '33.0.0'
minSdkVersion = 23
targetSdkVersion 30
compileSdkVersion 31
androidXCoreVersion = "1.8.0"
androidXCompatVersion = "1.5.1"
}
allprojects {
// Nativescript by default runs this hook for all plugin builds,
// but we want to run it only when the main app builds.
if (!rootProject.projectDir.absolutePath.contains("tempPlugin")) {
// We are replacing com.facebook.react:react-native with our local :react library in all linked libraries.
// We could do this inside the module itself but we want the module to work in both
// react-native & nativescript
configurations {
all {
resolutionStrategy {
dependencySubstitution {
substitute module("com.facebook.react:react-native") using project(":react") because "we will replace this with our local react"
}
}
}
}
}
}
from open-native.
Hey, use this below, the above has some mistakes:
ext {
// The version used here should be same as the one's
// set in app.gradle file.
buildToolsVersion = '31.0.0'
minSdkVersion = 23
targetSdkVersion = 30
compileSdkVersion = 31
androidXCoreVersion = "1.3.1"
androidXCompatVersion = "1.3.1"
}
allprojects {
// Nativescript by default runs this hook for all plugin builds,
// but we want to run it only when the main app builds.
if (!rootProject.projectDir.absolutePath.contains("tempPlugin")) {
// We are replacing com.facebook.react:react-native with our local :react library in all linked libraries.
// We could do this inside the module itself but we want the module to work in both
// react-native & nativescript
configurations {
all {
resolutionStrategy {
dependencySubstitution {
substitute module("com.facebook.react:react-native") using project(":react") because "we will replace this with our local react"
}
}
}
}
}
}
The app is building fine on my side.
from open-native.
@ammarahm-ed The error is changes but about the same.
\before-plugins.gradle' line: 23
A problem occurred evaluating script.
No signature of method: org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutions$1.using() is applicable for argument types: (org.gradle.internal.component.local.model.DefaultProjectComponentSelector) values: [project :react]
Possible solutions: find(), print(java.io.PrintWriter), print(java.lang.Object), use([Ljava.lang.Object;), find(groovy.lang.Closure), wait()
Command gradlew.bat failed with exit code 1
from open-native.
What version of Nativescript are you using? also do ns clean
once then try again.
from open-native.
ns info
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 8.2.3 and the latest available version is 8.4.0.
⚠ Update available for component @nativescript/core. Your current version is 8.1.5 and the latest available version is 8.4.1.
⚠ Update available for component @nativescript/ios. Your current version is 8.1.0 and the latest available version is 8.4.0.
⚠ Update available for component @nativescript/android. Your current version is 8.1.1 and the latest available version is 8.4.0.
i did a ns clean but nothing changed
from open-native.
@Atomico001 try update all dependencies of ns
from open-native.
@Atomico001 can you upgrade your project to 8.4.0? It works properly on 8.4.0 & above.
from open-native.
Ok, i will updated everything.. (hard job)
now i succesfull installed open-native and now it builds finally!
so i installed the plugin goal https://github.com/MacKentoch/react-native-beacons-manager
and now when i build i have this error:
node_modules\react-native-beacons-manager\android\build.gradle' line: 30
A problem occurred evaluating project ':react-native-beacons-manager'.
Could not find method compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Command gradlew.bat failed with exit code 1
app.gradle:
buildToolsVersion = '33.0.0'
minSdkVersion 23
targetSdkVersion 33
compileSdkVersion 33
so i used this before-plugins.gradle:
ext {
// The version used here should be same as the one's
// set in app.gradle file.
buildToolsVersion = '33.0.0'
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
androidXCoreVersion = "1.8.0"
androidXCompatVersion = "1.5.1"
}
allprojects {
// Nativescript by default runs this hook for all plugin builds,
// but we want to run it only when the main app builds.
if (!rootProject.projectDir.absolutePath.contains("tempPlugin")) {
// We are replacing com.facebook.react:react-native with our local :react library in all linked libraries.
// We could do this inside the module itself but we want the module to work in both
// react-native & nativescript
configurations {
all {
resolutionStrategy {
dependencySubstitution {
substitute module("com.facebook.react:react-native") using project(":react") because "we will replace this with our local react"
}
}
}
}
}
}
from open-native.
Ok, i follow all instruction. It build.
From your instruction now i can use the module without problem.
so i follow the readme and:
import Beacons from '@hkpuits/react-native-beacons-manager'
the problem is that i receive:
...node_modules/@hkpuits/react-native-beacons-manager/typings/react-native-beacons-manager.d.ts' is not a module.ts(2306)
Don't know if it is a module problem or something with openNative.
from open-native.
Try importing as follows: import Beacons from '@hkpuits/react-native-beacons-manager/index.js'
.
from open-native.
Related Issues (12)
- react-native-app-auth errors HOT 1
- Fatal error...new NativeEventEmitter() requires a non-null argument HOT 1
- Dark mode Docs issue, iOS, install-module page HOT 2
- [bug] Unable to marshal native value to JS HOT 2
- (Android) RCTNativeAppEventEmitter not found HOT 1
- react-native-quick-crypto not working HOT 1
- Issue with react-native-app-auth HOT 18
- Component Support? HOT 1
- Error implementing @react-native-firebase/messaging on Android HOT 3
- react_native_rsa_native/RNRSA.h' file not found HOT 4
- react-native-tcp-socket error NativeModules.TcpSockets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-native.