Categories
Android shell

Cyanogenmod Gapps error with SetupWizard

I saw that CM13 is out and it brings Android 6.0.1 (r17) goodies such as the battery saving ‘doze’ functionality and new permissions model, alongside the usual set of CM features. I have an HTC m8 sitting around which I figure was due for a custom rom right about now, so I downloaded and install a copy of CM 13 from https://get.cm. everything went well as expected. I downloaded a copy of google apps from opengapps and installed it next and thats where things took a turn for the worse, as soon as I booted into CM i started getting errors of setup wizard being force closed over and over. I couldnt do anything but click the OK button over and over. So if you are getting a Cyanogenmod Gapps error this just may help you.

I booted into TWRP and tried fixing permission with no luck on next boot into system. I tried re-flashing everything from a clean install again with same results. I saw that you could report the issue so I clicked the submit button and it let me see the actual error that was being thrown which looked partially like :

AndroidRuntime: java.lang.RuntimeException: Unable to create application com.google.android.setupwizard.SetupWizardApplication: java.lang.SecurityException: addOnSubscriptionsChangedListener: Neither user 10069 nor current process has android.permission.READ_PHONE_STATE.

luckily I had enabled debugging before I installed gapps. so I connected my phone to my computer, booted up ADB, check out my post on some basic ADB commands here if you need a refresher, and granted the permissions needed for the issue to be resolved!

I checked for connected device :

adb devices

which gave me :

List of devices attached
FA43XXXXXXXX    device
emulator-5554   device

I then ran commands on my phone by connected to the shell on it and running my grant command:

adb -s FA43XXXXXXXX shell
pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE

it gave no output and looked like this :

C:\Users\sumguy\adb>adb -s FA43XXXXXXXX shell
[email protected]:/ $ pm grant com.google.android.setupwizard android.permission.READ_PHONE_STATE
[email protected]:/ $

This can be adapted for other such error also:

pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION

this seems to have resolved the issue for me and I was able to login to my account normally now with no crashes so far.

Categories
Linux

Crashplan Linux Headless Wont backup

I just installed crashplan on a new linux headless server and it refused to backup, I checked logs and found it was having issues with the noexec flag on my /tmp/ folder. so I created a new tmp folder and told it where to access it. In this article I give simple instructions on how to fix Crashplan Linux Headless backup errors.

The main folder for Crashplan Linux Headless install for me is :

/usr/local/crashplan

so I created tmp folder within it and made it 777 (probably unsafe somehow)

mkdir /usr/local/crashplan/tmp
chmod 777 /usr/local/crashplan/tmp

edit /usr/local/crashplan/bin/run.conf and in the first line from

SRV_JAVA_OPTS=”-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0″

change to

SRV_JAVA_OPTS=”-Djava.io.tmpdir=/usr/local/crashplan/tmp -Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx512m -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0″

so basically just add -Djava.io.tmpdir=/usr/local/crashplan/tmp

 

another thing is 512MB is very low amount of max ram for a large server with lots of backed up files so I changed that also. I changed the part in red from 512 to 2048 (which is 2 GB). Crashplan suggests 1GB ram per 1TB of backup. this is ofcourse a rough number and I have not followed it in my usage for Crashplan Linux Headless installs but its a good number to keep in mind where possible.

SRV_JAVA_OPTS=”-Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx2048m -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0″

 

with both above tweaks it will look like this :

SRV_JAVA_OPTS=”-Djava.io.tmpdir=/usr/local/crashplan/tmp -Dfile.encoding=UTF-8 -Dapp=CrashPlanService -DappBaseName=CrashPlan -Xms20m -Xmx2048m -Dsun.net.inetaddr.ttl=300 -Dnetworkaddress.cache.ttl=300 -Dsun.net.inetaddr.negative.ttl=0 -Dnetworkaddress.cache.negative.ttl=0″

[/et_pb_text][/et_pb_column][/et_pb_row][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”bottom above footer” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

[/et_pb_text][et_pb_divider admin_label=”Divider” color=”#ffffff” show_divider=”off” divider_style=”solid” divider_position=”top” hide_on_mobile=”on”] [/et_pb_divider][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”] [jetpack-related-posts] [/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]