Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename appliaction package name - Not able to compile #22965

Closed
FrazeColder opened this issue Jan 11, 2019 · 2 comments
Closed

Rename appliaction package name - Not able to compile #22965

FrazeColder opened this issue Jan 11, 2019 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@FrazeColder
Copy link

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 with com.awesome.project.

/android/app/BUCK:

android_build_config(
...
package = 'com.awesome.project',
)
android_resource(
...
package = 'com.awesome.project',
)

android/app/src/main/AndroidManifest.xml

package="com.awesome.project"

android/app/build.gradle

defaultConfig {
    applicationId "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!

@hramos
Copy link
Contributor

hramos commented Jan 11, 2019

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.

If you'd like help troubleshooting or working throughout your issue, we have a list of community resources that should help: http://facebook.github.io/react-native/help.html

@FrazeColder
Copy link
Author

Hey @hramos,

I just submitted a new issue here: #22967
Hope you guys can help me and figure out the bug or the solution!

Kind regards

@hramos hramos closed this as completed Jan 11, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Jan 11, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants