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
I want to rename my package name for my react native android application and I am trying to solve the problem since 3 days already.
So, to be completely sure I am doing everything correct I have created a new project and tried to rename the package name. I have done this to be sure the error is not coming from my project and I haven't been able to fix my error yet.
I have initialized a new project like always: react-native init MyAwesomeProject .
Then I have replaced com.myawesomeproject in the following files with com.awesome.project.
Also I have replaced package com.myawesomeproject; with package com.awesome.project; and moved the MainActivity.java and MainApplication.java file from android/app/src/main/java/com/myawesomeproject/to the new path android/app/src/main/java/com/awesome/myawesomeproject/.
After I have done all those changes I runned ./gradlew clean inside my android folder followed by this command react-native run-android.
However, I am still facing exact the same problem I am facing in my actual project.
> Task :app:compileDebugJavaWithJavac FAILED
/Users/max/Desktop/Max/MyAwesomeProject/android/app/src/main/java/com/myawesomeproject/MainApplication.java:19: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
1 error
FAILURE: Build failed with an exception.
Also, I have already tried to add the following code to the top of the MainApplication.java file:
import com.facebook.react.BuildConfig;
But I have added the code to the MainApplication.java located in android/app/src/main/java/com/myawesomeproject like it is saying it in the error output. If you do that, the console is not throwing any error after running react-native run-android, however, the App myawesomeproject gets installed and if you try to open it, the app crashes.
This clearly shows that react is still using the wrong path!
I even have tried the npm rename package and runned the following command:
react-native-rename "project" -b com.project.
Not even this is solving my problem. I still get exactly the same error when running react-native run-android.
You guys can see the problem is not coming from my project cause I have exactly the same problem after I have set up a new project which is completely build from the scratch!
The text was updated successfully, but these errors were encountered:
Hey there, sorry you're having trouble. We're using GitHub to track individual, reproducible bugs. Could you use the provided template to describe the issue? Specifically, we'd like to see a list of steps to reproduce it. Ideally, we'd like to see a minimal example of how this can be reproduced on a new project.
Environment
React Native Environment Info:
System:
OS: macOS 10.14.1
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 32.00 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.13.0 - /usr/local/bin/node
Yarn: 1.12.1 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 27
Build Tools: 26.0.3, 27.0.3, 28.0.2, 28.0.3
System Images: android-27 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.57.8 => 0.57.8
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native-rename: 2.4.0
Description
I want to rename my package name for my react native android application and I am trying to solve the problem since 3 days already.
So, to be completely sure I am doing everything correct I have created a new project and tried to rename the package name. I have done this to be sure the error is not coming from my project and I haven't been able to fix my error yet.
I have initialized a new project like always:
react-native init MyAwesomeProject
.Then I have replaced
com.myawesomeproject
in the following files withcom.awesome.project
./android/app/BUCK:
android/app/src/main/AndroidManifest.xml
android/app/build.gradle
Also I have replaced
package com.myawesomeproject;
withpackage com.awesome.project;
and moved theMainActivity.java
andMainApplication.java
file fromandroid/app/src/main/java/com/myawesomeproject/
to the new pathandroid/app/src/main/java/com/awesome/myawesomeproject/
.After I have done all those changes I runned
./gradlew clean
inside my android folder followed by this commandreact-native run-android
.However, I am still facing exact the same problem I am facing in my actual project.
Also, I have already tried to add the following code to the top of the
MainApplication.java
file:import com.facebook.react.BuildConfig;
But I have added the code to the
MainApplication.java
located inandroid/app/src/main/java/com/myawesomeproject
like it is saying it in the error output. If you do that, the console is not throwing any error after runningreact-native run-android
, however, the Appmyawesomeproject
gets installed and if you try to open it, the app crashes.This clearly shows that react is still using the wrong path!
I even have tried the npm rename package and runned the following command:
react-native-rename "project" -b com.project
.Not even this is solving my problem. I still get exactly the same error when running
react-native run-android
.You guys can see the problem is not coming from my project cause I have exactly the same problem after I have set up a new project which is completely build from the scratch!
The text was updated successfully, but these errors were encountered: