Skip to content

Instantly share code, notes, and snippets.

View robUx4's full-sized avatar

Steve Lhomme robUx4

View GitHub Profile
@robUx4
robUx4 / settings.gradle
Created July 8, 2014 18:59
FileLogger gradle
// version 1
include ':dependencies:Android-FileLogger:library'
// version 2
include 'FileLogger'
project(':FileLogger').projectDir = new File('dependencies/Android-FileLogger/library')
@robUx4
robUx4 / project.gradle
Created September 1, 2014 07:39
Android-Switch workaround
dependencies {
def artifactAndroidSwitch = 'org.jraf:android-switch-backport:1.3.+'
def useLocalAndroidSwitch = false
def localAndroidSwitch = ':android-Switch'
allprojects {
rootProject.allprojects.project.each {
if (it.path == localAndroidSwitch) {
@robUx4
robUx4 / logcat
Created September 8, 2014 07:12
LG Optimus L9 running 4.4.4
java.lang.IllegalArgumentException: Optimized data directory /data/data/com.levelup.touiteur/cache is not owned by the current user. Shared storage cannot protect your application from code injection attacks.
at dalvik.system.DexFile.(DexFile.java:102)
at dalvik.system.DexFile.loadDex(DexFile.java:151)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:266)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.(BaseDexClassLoader.java:48)
at dalvik.system.DexClassLoader.(DexClassLoader.java:57)
at vi.a(SourceFile:91)
at vk.a(SourceFile:68)
@robUx4
robUx4 / PhoneWindow.java
Created November 12, 2014 09:14
windowDrawsSystemBarBackgrounds WTF
// Non-floating windows on high end devices must put up decor beneath the system bars and
// therefore must know about visibility changes of those.
if (!mIsFloating && ActivityManager.isHighEndGfx()) {
if (!targetPreL && a.getBoolean(
R.styleable.Window_windowDrawsSystemBarBackgrounds,
false)) {
setFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS,
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS & ~getForcedWindowFlags());
}
}
@robUx4
robUx4 / FontManager.java
Created November 20, 2014 11:01
Basic Font setter
package com.levelup.touiteur;
import android.graphics.Typeface;
import android.util.SparseArray;
import android.widget.TextView;
import com.levelup.touiteur.log.TouiteurLog;
public class FontManager {
@robUx4
robUx4 / proguard.txt
Created November 26, 2014 06:50
This fix doesn't fix
# try to avoid this issue on Samsung 4.2.2 https://code.google.com/p/android/issues/detail?id=78377
-keep class !android.support.v7.internal.view.menu.MenuBuilder
-keep class !android.support.v7.internal.view.menu.SubMenuBuilder
@robUx4
robUx4 / crash.log
Created December 1, 2014 08:20
Rooted Nexus 4
java.lang.NullPointerException
at com.qihoo.sandbox.monitor.SystemMonitor$SendBroadcastThread.SendRegisterBroadcast(SystemMonitor.java:40)
at com.qihoo.sandbox.monitor.SystemMonitor$SendBroadcastThread.run(SystemMonitor.java:77)
@robUx4
robUx4 / build.gradle
Last active August 29, 2015 14:10
Gradle plugin transition from 0.12/0.13 to 0.14/1.0.0
// enable proguard on all version of the android gradle plugin
release {
if (!properties.findAll{it.key == 'runProguard'}.isEmpty()) {
runProguard true
} else if (!properties.findAll{it.key == 'minifyEnabled'}.isEmpty()) {
minifyEnabled true
}
}
// detect proguard in a variant
@robUx4
robUx4 / logcat.4.0.4.txt
Last active August 29, 2015 14:10
LG running android 4.1.2
java.lang.NullPointerException
at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:892)
at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1580)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1960)
at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3370)
at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3343)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2503)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4573)
@robUx4
robUx4 / gradle log
Created December 8, 2014 14:21
Setting multiDexEnabled true
Error:Execution failed for task ':Plume:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\android-sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --multi-dex --main-dex-list C:\Users\Dell990MT\Documents\Program\LevelUp\Plume\work\Plume\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\Dell990MT\Documents\Program\LevelUp\Plume\work\Plume\build\intermediates\dex\debug --input-list=C:\Users\Dell990MT\Documents\Program\LevelUp\Plume\work\Plume\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
3
Output:
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:1048)
at com.android.dx.cf.code.Ropper.doit(Ropper.java:742)