Skip to content

Commit e092698

Browse files
authored
Change the Android package name to not be the default name generated by the React Native CLI (#99)
We never changed the default Android package name generated by the React Native CLI when you first create the module/package. This didn't seem to matter as it is basically an implementation detail, but it turns out if multiple packages do this, they conflict in the gradle build. So this change just gives the Android package a unique name (babylonreactnative), which should resolve this issue.
1 parent e5410ed commit e092698

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

Modules/@babylonjs/react-native/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def configureReactNativePom(def pom) {
125125
name packageJson.title
126126
artifactId packageJson.name
127127
version = packageJson.version
128-
group = "com.reactlibrary"
128+
group = "com.babylonreactnative"
129129
description packageJson.description
130130
url packageJson.repository.baseUrl
131131

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.reactlibrary">
2+
package="com.babylonreactnative">
33

44
</manifest>

Modules/@babylonjs/react-native/android/src/main/cpp/BabylonNativeInterop.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ namespace Babylon
102102
};
103103
}
104104

105-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_initialize(JNIEnv* env, jclass obj, jobject context)
105+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_initialize(JNIEnv* env, jclass obj, jobject context)
106106
{
107107
JavaVM* javaVM{};
108108
if (env->GetJavaVM(&javaVM) != JNI_OK)
@@ -113,22 +113,22 @@ extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_ini
113113
android::global::Initialize(javaVM, context);
114114
}
115115

116-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_setCurrentActivity(JNIEnv* env, jclass obj, jobject activity)
116+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_setCurrentActivity(JNIEnv* env, jclass obj, jobject activity)
117117
{
118118
android::global::SetCurrentActivity(activity);
119119
}
120120

121-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_pause(JNIEnv* env, jclass obj)
121+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_pause(JNIEnv* env, jclass obj)
122122
{
123123
android::global::Pause();
124124
}
125125

126-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_resume(JNIEnv* env, jclass obj)
126+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_resume(JNIEnv* env, jclass obj)
127127
{
128128
android::global::Resume();
129129
}
130130

131-
extern "C" JNIEXPORT jlong JNICALL Java_com_reactlibrary_BabylonNativeInterop_create(JNIEnv* env, jclass obj, jlong jsiRuntimeRef, jobject jsCallInvokerHolder, jobject surface)
131+
extern "C" JNIEXPORT jlong JNICALL Java_com_babylonreactnative_BabylonNativeInterop_create(JNIEnv* env, jclass obj, jlong jsiRuntimeRef, jobject jsCallInvokerHolder, jobject surface)
132132
{
133133
auto jsiRuntime = reinterpret_cast<jsi::Runtime*>(jsiRuntimeRef);
134134
auto callInvoker = jni::alias_ref<react::CallInvokerHolder::javaobject> {reinterpret_cast<react::CallInvokerHolder::javaobject>(jsCallInvokerHolder)}->cthis()->getCallInvoker();
@@ -137,26 +137,26 @@ extern "C" JNIEXPORT jlong JNICALL Java_com_reactlibrary_BabylonNativeInterop_cr
137137
return reinterpret_cast<intptr_t>(native);
138138
}
139139

140-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_refresh(JNIEnv* env, jclass obj, jlong instanceRef, jobject surface)
140+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_refresh(JNIEnv* env, jclass obj, jlong instanceRef, jobject surface)
141141
{
142142
auto native = reinterpret_cast<Babylon::Native*>(instanceRef);
143143
ANativeWindow* windowPtr = ANativeWindow_fromSurface(env, surface);
144144
native->Refresh(windowPtr);
145145
}
146146

147-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_setPointerButtonState(JNIEnv* env, jclass obj, jlong instanceRef, jint pointerId, jint buttonId, jboolean isDown, jint x, jint y)
147+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_setPointerButtonState(JNIEnv* env, jclass obj, jlong instanceRef, jint pointerId, jint buttonId, jboolean isDown, jint x, jint y)
148148
{
149149
auto native = reinterpret_cast<Babylon::Native*>(instanceRef);
150150
native->SetPointerButtonState(static_cast<uint32_t>(pointerId), static_cast<uint32_t>(buttonId), isDown, static_cast<uint32_t>(x), static_cast<uint32_t>(y));
151151
}
152152

153-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_setPointerPosition(JNIEnv* env, jclass obj, jlong instanceRef, jint pointerId, jint x, jint y)
153+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_setPointerPosition(JNIEnv* env, jclass obj, jlong instanceRef, jint pointerId, jint x, jint y)
154154
{
155155
auto native = reinterpret_cast<Babylon::Native*>(instanceRef);
156156
native->SetPointerPosition(static_cast<uint32_t>(pointerId), static_cast<uint32_t>(x), static_cast<uint32_t>(y));
157157
}
158158

159-
extern "C" JNIEXPORT void JNICALL Java_com_reactlibrary_BabylonNativeInterop_destroy(JNIEnv* env, jclass obj, jlong instanceRef)
159+
extern "C" JNIEXPORT void JNICALL Java_com_babylonreactnative_BabylonNativeInterop_destroy(JNIEnv* env, jclass obj, jlong instanceRef)
160160
{
161161
auto native = reinterpret_cast<Babylon::Native*>(instanceRef);
162162
delete native;

Modules/@babylonjs/react-native/android/src/main/java/com/reactlibrary/BabylonModule.java renamed to Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/BabylonModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import android.os.Handler;
44
import android.os.Looper;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import android.app.Activity;
44
import android.content.Context;

Modules/@babylonjs/react-native/android/src/main/java/com/reactlibrary/BabylonPackage.java renamed to Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/BabylonPackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import java.util.Arrays;
44
import java.util.List;

Modules/@babylonjs/react-native/android/src/main/java/com/reactlibrary/EngineView.java renamed to Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import android.annotation.TargetApi;
44
import android.graphics.Bitmap;

Modules/@babylonjs/react-native/android/src/main/java/com/reactlibrary/EngineViewManager.java renamed to Modules/@babylonjs/react-native/android/src/main/java/com/babylonreactnative/EngineViewManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import androidx.annotation.NonNull;
44
import androidx.annotation.Nullable;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.reactlibrary;
1+
package com.babylonreactnative;
22

33
import com.facebook.react.bridge.Arguments;
44
import com.facebook.react.bridge.WritableMap;

Package/Android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def configureReactNativePom(def pom) {
8787
name packageJson.title
8888
artifactId packageJson.name
8989
version = packageJson.version
90-
group = "com.reactlibrary"
90+
group = "com.babylonreactnative"
9191
description packageJson.description
9292
url packageJson.repository.baseUrl
9393

0 commit comments

Comments
 (0)