-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
MainActivity.java file deleted on build when package name is changed in config.xml #1139
Comments
The workaround is to remove all platform and re-adding them before a cordova build. It works, but it's take longer to make build. |
Yes, and the package name has to be changed before re-adding the android platform. I'd rather not have to do this because it takes longer to rebuild like you say |
Same issue here |
Sorry to dig up this issue but i'm having this problem again with cordova-android@12.0.0. If I downgrade to 11.0.0 (the release where its been fixed) it's working absolutely fine. Is there a reason why v12 reintroduced this "bug"? |
The changes between v11 and v12.0.1 can be found at rel/11.0.0...12.0.1 though nothing really stands out of why this may have regressed. If it did I'd recommend creating a new issue so we can track it appropriately. |
Can confirm that this does not seem to be working. For me the |
Bug Report
Problem
MainActivity.java file is deleted when the package name changes
What is expected to happen?
When the package name is changed in config.xml, the MainActivity.java file is moved to the correct namespace path following the package name (E.g. io.cordova.hellocordova => io/cordova/hellocordova)
This allows an app to be built with different package names so it can be installed side by side on a device.
What does actually happen?
The MainActivity.java file that exists for the previous package name gets deleted and a new one in the path for the new package name is not created.
Information
changing the package name of the app in the config.xml between builds results in the android platform folder becoming broken because the MainActivity.java file gets deleted. It is only created when the platform is added.
I commented on the commit that broke this. Package name changes were supported in 8.1.0. see 3712619#r43030914
Command or Code
cordova run android
cordova run android
cordova run android
Environment, Platform, Device
Windows 10 developer machine.
Android target platform.
Version information
Cordova Packages:
Project Installed Platforms:
Project Installed Plugins:
Environment:
android Environment:
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
Invoking "C:\dev\android-sdk\tools\bin\avdmanager" "list" "target"
Loading local repository...
[========= ] 25% Loading local repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[========= ] 25% Fetch remote repository...
[=======================================] 100% Fetch remote repository...
Available Android targets:
id: 1 or "android-28"
Name: Android API 28
Type: Platform
API level: 28
Revision: 6
id: 2 or "android-29"
Name: Android API 29
Type: Platform
API level: 29
Revision: 5
id: 3 or "android-30"
Name: Android API 30
Type: Platform
API level: 30
Revision: 3
Project Setting Files:
--- Start of Cordova JSON Snippet ---
{
"plugins": {
"cordova-plugin-whitelist": {}
},
"platforms": [
"android"
]
}
--- End of Cordova JSON Snippet ---
Checklist
The text was updated successfully, but these errors were encountered: