Status Update
Comments
uc...@google.com <uc...@google.com>
al...@google.com <al...@google.com>
vi...@google.com <vi...@google.com>
di...@google.com <di...@google.com> #2
Same here. I have links in a local html file referencing file:///android_res/drawable/ and on all gradle build flavors using another applicationId (added suffix) the Webview only shows broken links.
This behaviour seems not to be connected solely to Android 5.0 since it occurs on Android 4.4.4 too (tested with current cyanogenmod 11 build).
This behaviour seems not to be connected solely to Android 5.0 since it occurs on Android 4.4.4 too (tested with current cyanogenmod 11 build).
lu...@ozrunways.com <lu...@ozrunways.com> #3
As a hotfix I added the following code to the gradle buildscript, which generates an additional R.java with changed java package for every flavor. I don't like this solution though.
android.applicationVariants.all{ variant ->
variant.javaCompile.doFirst{
copy {
from "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/R.java"
into "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${variant.buildType.name }/"
}
File rFile = file("${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${variant.buildType.name }/R.java")
String content = rFile.getText('UTF-8')
String newPackageName = "com.example.application.${variant.buildType.name }";
content = content.replaceAll(/com.example.application/, newPackageName)
rFile.write(content, 'UTF-8')
}
}
android.applicationVariants.all{ variant ->
variant.javaCompile.doFirst{
copy {
from "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/R.java"
into "${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${
}
File rFile = file("${buildDir}/generated/source/r/${variant.dirName}/com/example/application/${
String content = rFile.getText('UTF-8')
String newPackageName = "com.example.application.${
content = content.replaceAll(/com.example.application/, newPackageName)
rFile.write(content, 'UTF-8')
}
}
so...@google.com <so...@google.com>
[Deleted User] <[Deleted User]> #4
Comment has been deleted.
Description
Note that choosing to open the project by choosing it from the recent projects list on the welcome screen works as expected (ie stuff is not deleted). I would expect the Open button to work like this.
Repro steps showing shelved changes go missing, but all other settings also go missing:
- New project wizard, create blank activity
- In the MainActivity file, make some changes - eg delete the onCreate method (exact changes don't matter)
- In "Version control" tool window, right click MainActivity and choose "Shelve changes" and confirm.
- Note that this shows another tab "Shelf" in the tool window, which contains 1 file, with the changes just made
- File > Close Project; welcome screen should now be shown
Path 1 (recent project):
- Click on the project at the top of the list on the left-side of recent projects on the welcome screen
- Note it opens and 1 file is still in the shelf (Desired behavior)
- File > Close Project; welcome screen should now be shown again
Path 2 (open existing):
- Click "Open an existing Android Studio Project" on the welcome screen
- Navigate file chooser to select directory containing the project created above (note that the directory has an Android Studio icon instead of a folder, denoting it's already an Studio project)
- Note that add file to VCS dialog appears (why does opening an existing project add a file?)
- Note that Version Control tool window > Shelf is empty (the changes shelved above have been deleted without warning)
I would expect Path 2 to result in the same effects as Path 1. Further, if opening the project needs to be destructive, I would expect some sort of confirmation prompt before deleting user files in the project.
Build: 3.3 Canary 13, AI-182.4505.22.33.5035453, 201809272200, AI-182.4505.22.33.5035453, JRE 1.8.0_152-release-1248-b01x64 JetBrains s.r.o, OS Linux(amd64) v4.18.9-arch1-1-ARCH unknown, screens 1600x900
Android Gradle Plugin: 3.3.0-alpha13
Gradle: 4.10.2
NDK: from local.properties: 18.0.5002713; latest from SDK: 18.0.5002713; LLDB: pinned revision 3.1 not found; latest from SDK: (package not found); CMake: from local.properties: (not specified); latest from SDK: (not found); from PATH: 3.12.2; IMPORTANT: Please read