Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
th...@gmail.com <th...@gmail.com> #2
If it an help:
The wear apk is present in the mobile / generated / res / microapk / wear1 / release / raw / android_wear_micro_apk.apk
Same for mobile / generated / res / microapk / wear1 / release / xml / android_wear_micro_apk.xml, with correct information in it.
Same for mobile / build / generated / manifests / microapk / wear1 / release / AndroidManifest.xml, with correct information in it.
But in intermediates / merged_manifest / wear1Release / out / AndroidManifest.xml, we can not find the corresponding declaration:
<meta-data
android:name="com.google.android.wearable.beta.app "
android:resource="@xml/android_wear_micro_apk" />
But in the outputs / logs / manifest-merger-wear1-release-report.txt, there is no :
MERGED from [Wear App sub-manifest] C:\...\build\generated\manifests\microapk\release\wear1\AndroidManifest.xml:2:1-9:12
If I switch back to gradle 4.0.2, everything is fine, & wear apk is correctly embedded.
The wear apk is present in the mobile / generated / res / microapk / wear1 / release / raw / android_wear_micro_apk.apk
Same for mobile / generated / res / microapk / wear1 / release / xml / android_wear_micro_apk.xml, with correct information in it.
Same for mobile / build / generated / manifests / microapk / wear1 / release / AndroidManifest.xml, with correct information in it.
But in intermediates / merged_manifest / wear1Release / out / AndroidManifest.xml, we can not find the corresponding declaration:
<meta-data
android:name="
android:resource="@xml/android_wear_micro_apk" />
But in the outputs / logs / manifest-merger-wear1-release-report.txt, there is no :
MERGED from [Wear App sub-manifest] C:\...\build\generated\manifests\microapk\release\wear1\AndroidManifest.xml:2:1-9:12
If I switch back to gradle 4.0.2, everything is fine, & wear apk is correctly embedded.
je...@google.com <je...@google.com> #4
Amr, can you have a look at this soon, thanks !
th...@gmail.com <th...@gmail.com> #5
I actually found the cause: it was related to some task dependencies that I use to auto increment the version code from a file.
You can actually reproduce the problem by adding the following simplified code in the 'mobile' build.gradle of the WatchFace sample:
def code = 100
task('increaseVersionCode') {
doLast {
code = code + 1
println sprintf("VersionCode : %d", code)
}
}
tasks.whenTaskAdded { task ->
if (task.name == 'generateReleaseBuildConfig') {
task.dependsOn 'increaseVersionCode'
}
}
With Gradle plugin 4.0.2, the task is correctly executed (print VersionCode in logs), and wear apk is correctly embedded in mobile apk.
With Gradle plugin 4.1.1, the task is correctly executed (print VersionCode in logs), but wear apk is NOT embedded in mobile apk.
I don't know if this is something intended. I hope that it will help.
You can actually reproduce the problem by adding the following simplified code in the 'mobile' build.gradle of the WatchFace sample:
def code = 100
task('increaseVersionCode') {
doLast {
code = code + 1
println sprintf("VersionCode : %d", code)
}
}
tasks.whenTaskAdded { task ->
if (
task.dependsOn 'increaseVersionCode'
}
}
With Gradle plugin 4.0.2, the task is correctly executed (print VersionCode in logs), and wear apk is correctly embedded in mobile apk.
With Gradle plugin 4.1.1, the task is correctly executed (print VersionCode in logs), but wear apk is NOT embedded in mobile apk.
I don't know if this is something intended. I hope that it will help.
am...@google.com <am...@google.com> #6
Merged
As a workaround, you'll need to move the tasks.whenTaskAdded block to be done
te...@gmail.com <te...@gmail.com> #7
Still have same issue with 4.2 Beta 3
i get to connect to device
but when i click debug --select the watch
i get a time out
i also tried Killing-Restart location of the tool is good.
i can see the list of devices
when i try to install with PUSH
i get adb: connect error for write: closed
in Event Log i see
Failed to start monitoring10.0.0.241:5555
or Error during Sync: Unable to open sync connection!
then i get
2:39 p.m. Error Installation did not succeed. The application could not be installed. Retry
2:39 p.m. Session 'wear': Installation did not succeed. The application could not be installed. Retry
but when i try reconnect or connect says Already connected
i get to connect to device
but when i click debug --select the watch
i get a time out
i also tried Killing-Restart location of the tool is good.
i can see the list of devices
when i try to install with PUSH
i get adb: connect error for write: closed
in Event Log i see
Failed to start monitoring
or Error during Sync: Unable to open sync connection!
then i get
2:39 p.m. Error Installation did not succeed. The application could not be installed. Retry
2:39 p.m. Session 'wear': Installation did not succeed. The application could not be installed. Retry
but when i try reconnect or connect says Already connected
am...@google.com <am...@google.com> #8
This might be a non related bug as this bug only happens when you attach a whenTaskAdded listener. Can you file a new bug with the steps to reproduce?
Description
all required information.
compileSdkVersion 29
Android Studio 4.1.1
Build #AI-201.8743.12.41.6953283, built on November 5, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 8
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: Batch Scripts Support, CMD Support, org.jetbrains.kotlin
Version of Gradle Plugin: com.android.tools.build:gradle:4.1.0 & 4.1.1
Version of Gradle:
OS: Windows 10
Steps to Reproduce:
I have a project of watch face, with a mobile companion app, that embeds the wear apk in the mobile apk, for wear 1.5x support (old watches).
dependencies {
...
implementation fileTree(dir: 'libs', include: ['*.jar'])
wear1WearApp project(':wear')
...
}
Previously, with plugin version com.android.tools.build:gradle:4.0.2, when running gradlew assembleRelease, the mobile apk was correctly embedding the wear apk.
But since com.android.tools.build:gradle:4.1.0, the wear apk is no longer embedded in the mobile apk.