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

App fails to start after renaming #34

Closed
Zefau opened this issue Mar 5, 2019 · 6 comments
Closed

App fails to start after renaming #34

Zefau opened this issue Mar 5, 2019 · 6 comments

Comments

@Zefau
Copy link

Zefau commented Mar 5, 2019

Renaming the project updates the following files accordingly:

  • App/index.js
  • App/app.json
  • /android/settings.gradle

But the file MainActivity.java gets deleted once renaming the project. Thus /android/app/src/main/java/com/[yourprojectname]/MainActivity.java does not exist.

Manually copying and modifying the files solves the problem.
Thus, adaption of yarn run rename is required.

Originally posted by @Zefau in #22 (comment)

@fredbliss
Copy link

fredbliss commented Apr 20, 2019

+1 @Zefau thanks for spotting and figuring this out!

@AurelGit
Copy link
Collaborator

AurelGit commented May 9, 2019

Hey @Zefau and @intelligentspark !

It seems that the new version installed do not provide this error anymore.

I merged this PR #44 adding a link to this issue.

Thank you guys

@AurelGit AurelGit closed this as completed May 9, 2019
@joshuakoh7
Copy link

I got this error. I added MainApplication.java and MainActivity.java from the repo to the new folder and now I'm getting this error:

> Task :app:compileDebugJavaWithJavac FAILED
M:\Google Drive\SC\frontend\android\app\src\main\java\com\sc\MainApplication.java:20: error: cannot find symbol
      return BuildConfig.DEBUG;
             ^
  symbol: variable BuildConfig

@AurelGit
Copy link
Collaborator

Hello @joshuakoh7 !

Does the path of the MainActivity.java file is the same as your app package name ?

For example, in the boilerplate, the package name is com.boilerplate (you can found it in android/app/src/main/AndroidManifest.xml or android/app/build.gradle)
So, the path is android/app/src/main/java/com/boilerplate/MainApplication.java

Thanks

@joshuakoh7
Copy link

I fixed it. I had unknowingly capitalised the app name in AndroidManifest.xml so it couldn't find the right app.

@JakubBlaha
Copy link

I can see this issue is closed but I am still getting this issue.

Btw MainApplication.java is also getting deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants