account arrowhead-down arrowhead-up mobile-menu search sm-bold-x x-skinny-rounded x-skinny arrowhead-right social-facebook social-googleplus social-instagram social-linkedin social-pinterest social-qzone social-renren social-tencent social-twitter social-vkontakt social-weibo social-youku social-youtube

Please help us improve our website

Take our customer survey to evaluate your visit.

It should only take a few minutes to answer five quick questions. Just click the Launch survey button at the end of your visit to begin.

cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the Open Devices community!

This is where we discuss open source and development related questions on our Open Devices initiative.

Failed on adding patches [Marshmallow 6.0 AOSP]

SOLVED
Highlighted
Inhabitant
Message 1 of 9
4,364 Views
Message 1 of 9

Failed on adding patches [Marshmallow 6.0 AOSP]

Hi, I tried to build Marshmallow 6.0 AOSP folllowing 'Build AOSP Marshmallow 6.0'. However, while patching, I got errors saying "error: 'cherry-pick' is not possible because you have unmerged files...fatal: cherry-pick failed". Please let me know what I should do.

 

Here are detailed errors (I think two commands below cause the problem):

 

$ git cherry-pick 9cb3d3ccf49bf0fd484563fbf611c68789d5b8a9
$ git fetch https://android.googlesource.com/platform/system/core refs/changes/92/269692/1 && git cherry-pick FETCH_HEAD

 

 

error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed


From https://android.googlesource.com/platform/system/core
* branch refs/changes/92/269692/1 -> FETCH_HEAD
error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed

 

 

* FYI: after the errors, I tried to 'repo sync' again, and I found another error messages like below.

 

> ...

> Syncing work tree: 96% (473/492) error: you need to resolve your current index first
healthd/BatteryMonitor.cpp: needs merge

> ...

>error: system/core/: platform/system/core checkout 4482ae7a698e2fbe5b2ed79060cca811870313b3

 

 

* Edited: I re-captured detailed error messages

1 ACCEPTED SOLUTION

Accepted Solutions
Learner
Message 8 of 9
6,043 Views
Message 8 of 9

Re: [NEW Question] Failed on building AOSP (M6.0)

just comment out it, these code used for No battery device

KLOG_WARNING(LOG_TAG, "No battery devices found\n");

//hc->periodic_chores_interval_fast = -1;

//hc->periodic_chores_interval_slow = -1;

//mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;

//mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;

//mAlwaysPluggedDevice = true;

View solution in original post

8 REPLIES 8
Inhabitant
Message 2 of 9
4,306 Views
Message 2 of 9

Re: Failed on adding patches [Marshmallow 6.0 AOSP]

delete /system/core and re-sync (repo sync)

 

you should get  amessage at the end indicating that all the cherry-picks have been rolled back.

 

The next step is to then re cherry-pick all the commits.

 

If you still have issues of unmerged files, then you will need to go to the directory that has issues and type 

git status

this will give you more details on what files have the incomplete merged changes. You can then go to the files and check what needs adjusting. I would suggest looking at the cherry-picks changes on the web to ensure that your corrections are in line with them. 

 

Any thing that requires your attention will be indicated by >>>>> in markers like this and <<<<< out markers like this. Often it is a simple fix.

Inhabitant
Message 3 of 9
4,299 Views
Message 3 of 9

Re: Failed on adding patches [Marshmallow 6.0 AOSP]

To Sony: please fix this issue for novices.

 

@mcgi5sr2 Thank you. It was very helpful. After I re-synced again, I had still issues of unmerged files although I added the same cherry-pick changes on Sony's instruction. I had to add the problem file (system/core/healthd/BatteryMonitor.cpp) manually and re-do cherry-pick. And finally it worked.

 

Here is what I did:

$ git status
HEAD detached at f7f765f
You are currently cherry-picking commit 9cb3d3c.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
(use "git add <file>..." to mark resolution)

both modified: healthd/BatteryMonitor.cpp

no changes added to commit (use "git add" and/or "git commit -a")

 

$ git add healthd/BatteryMonitor.cpp
$ git cherry-pick --continue
[detached HEAD 54c2574] healthd: Check if battery device exists instead of charger drivers before setting fake properties.
Author: Ruchi Kandoi <kandoiruchi@google.com>
1 file changed, 5 insertions(+), 2 deletions(-)

 

$ git fetch https://android.googlesource.com/platform/system/core refs/changes/92/269692/1 && git cherry-pick FETCH_HEAD
From https://android.googlesource.com/platform/system/core
* branch refs/changes/92/269692/1 -> FETCH_HEAD
[detached HEAD 941931b] healthd: Reinitialize mChargerNames for every battery update
Author: Ramakrishnan Ganesh <ramakris@codeaurora.org>
1 file changed, 60 insertions(+), 32 deletions(-)

 

Inhabitant
Message 4 of 9
4,290 Views
Message 4 of 9

Re: Failed on adding patches [Marshmallow 6.0 AOSP]

Hi,

no worries glad it helped.

 

Did you fix the conflicts in the file before using the git add command?

 

Inhabitant
Message 5 of 9
4,284 Views
Message 5 of 9

Re: Failed on adding patches [Marshmallow 6.0 AOSP]

 

 

 

@mcgi5sr2 Yes. I modified the conflict part. However, I am not sure I've done rightThinking Face. I followed this commit.

 

- Conflict part:

<<<<<<< HEAD
if (!mChargerNames.size())
KLOG_ERROR(LOG_TAG, "No charger supplies found\n");
=======
// Typically the case for devices which do not have a battery and
// and are always plugged into AC mains.
>>>>>>> 9cb3d3c... healthd: Check if battery device exists instead of charger drivers before
if (!mBatteryDevicePresent) {
KLOG_WARNING(LOG_TAG, "No battery devices found\n");
hc->periodic_chores_interval_fast = -1;
hc->periodic_chores_interval_slow = -1;
mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;
mAlwaysPluggedDevice = true;
} else {

 

 

- What I did:
// Typically the case for devices which do not have a battery and
// and are always plugged into AC mains.
if (!mBatteryDevicePresent) {
KLOG_WARNING(LOG_TAG, "No battery devices found\n");
hc->periodic_chores_interval_fast = -1;
hc->periodic_chores_interval_slow = -1;
mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;
mAlwaysPluggedDevice = true;
} else {

Inhabitant
Message 6 of 9
4,235 Views
Message 6 of 9

[NEW Question] Failed on building AOSP (M6.0)

[Because forum managers doesn't allow me to make a new post (duplicate posts),  I'm adding this here (I thought this new problem was different from patching errors mentioned above.]

----------------------------------------------------------------------------------------

 

I was trying to build AOSP (M 6.0). After I barely solved the patching issue, I got another errors seemed to be related with it. Both devices (Z5 and Z1) had the same error messages. Please see the errors below and let me know what I should do.

Errors:
1. Xperia Z5:
system/core/healthd/BatteryMonitor.cpp: In member function 'void android::BatteryMonitor::init(healthd_config*)':
system/core/healthd/BatteryMonitor.cpp:579:33: error: 'ALWAYS_PLUGGED_CAPACITY' was not declared in this scope
mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
^
system/core/healthd/BatteryMonitor.cpp:581:9: error: 'mAlwaysPluggedDevice' was not declared in this scope
mAlwaysPluggedDevice = true;
^
make: *** [out/target/product/sumire/obj/EXECUTABLES/healthd_intermediates/BatteryMonitor.o] Error 1

2. Xperia Z1:
system/core/healthd/BatteryMonitor.cpp: In member function 'void android::BatteryMonitor::init(healthd_config*)':
system/core/healthd/BatteryMonitor.cpp:579:33: error: 'ALWAYS_PLUGGED_CAPACITY' was not declared in this scope
mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;
^
system/core/healthd/BatteryMonitor.cpp:581:9: error: 'mAlwaysPluggedDevice' was not declared in this scope
mAlwaysPluggedDevice = true;
^
make: *** [out/target/product/honami/obj/EXECUTABLES/healthd_intermediates/BatteryMonitor.o] Error 1

 

 

 

Inhabitant
Message 7 of 9
4,152 Views
Message 7 of 9

Re: [NEW Question] Failed on building AOSP (M6.0)

I'm still have the same problem above. I can't build M6.0 AOSP for Xperia Z5 and Z1.

Please let me know what else I can do for it.

 

 

system/core/healthd/BatteryMonitor.cpp:579:33: error: 'ALWAYS_PLUGGED_CAPACITY' was not declared in this scope

system/core/healthd/BatteryMonitor.cpp:581:9: error: 'mAlwaysPluggedDevice' was not declared in this scope

Learner
Message 8 of 9
6,044 Views
Message 8 of 9

Re: [NEW Question] Failed on building AOSP (M6.0)

just comment out it, these code used for No battery device

KLOG_WARNING(LOG_TAG, "No battery devices found\n");

//hc->periodic_chores_interval_fast = -1;

//hc->periodic_chores_interval_slow = -1;

//mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY;

//mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE;

//mAlwaysPluggedDevice = true;

View solution in original post

Inhabitant
Message 9 of 9
4,095 Views
Message 9 of 9

Re: [NEW Question] Failed on building AOSP (M6.0)

@DzungLe: thank you. It worked. I've commented out them and the building succeeded.

 

@Sony: please provide another patches for this problem. Some variables should be defined (see below). Also, don't forget to fix 'cherry-pick' error (unmerged files) above.

 

system/core/healthd/BatterMonitor.h
bool mAlwaysPluggedDevice;

 

system/core/healthd/BatterMonitor.cpp
#define ALWAYS_PLUGGED_CAPACITY 100