Android 问题集合

Failed converting ECJ parse tree to Lombok for file E:\AndroidStudioProjects\HSH\hsh_lib\src\main\java\com\dhwl\hsh\lib\utils\RxUtils.java java.lang.UnsupportedOperationException: Unknown ASTNode child: LambdaExpression 使用java8 当前com.android.tools.lint版本与Retrolambda冲突

http://blog.csdn.net/dhx20022889/article/details/46894469


Execution failed for task ‘:hsh_merchant:processDebugResources’.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\android-sdk-windows\build-tools\23.0.3\aapt. exe'' finished with non-zero exit value 1 资源相关error未解决完。 http://stackoverflow.com/questions/29450620/aapt-exe-finished-with-non-zero-exit-value-1 http://stackoverflow.com/questions/30899963/how-to-fix-22-0-1-aapt-exe-finished-with-non-zero-exit-value-1
android studio custom view rendering problems

降低预览版本


65536 方法上限问题

method ID not in [0, 0xffff]: 65536 https://developer.android.com/studio/build/multidex.html#avoid
android {
    compileSdkVersion 21
    buildToolsVersion "21.1.0"

    defaultConfig {
        ...
        minSdkVersion 14
        targetSdkVersion 21
        ...

        // Enabling multidex support.
        multiDexEnabled true
    }
    ...
}

dependencies {
  compile 'com.android.support:multidex:1.0.0'
}
"1.0" encoding="utf-8"?>
"http://schemas.android.com/apk/res/android"
    package="com.example.android.multidex.myapplication">
    ...
        android:name="android.support.multidex.MultiDexApplication">
        ...
    

或者

Note: If your app uses extends the Application class, you can override the attachBaseContext() method and call MultiDex.install(this) to enable multidex. For more information, see the MultiDexApplication reference documentation.

A problem was found with the configuration of task ':app:packageRelease'. File 'E:\StudioProjects\GanWuMei\GanWuMei\app\build\intermediates\res\resources-release-stripped.ap_' specified for property 'resourceFile' does not exist.

试了如下配置,没用。
Android 问题集合_第1张图片

这个方法解决问题

buildTypes {
    release {
        minifyEnabled false
        shrinkResources false  // true -> false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

minifyEnabled 是开启混淆 shrinkResources 删除无效的Resource shrinkResources依赖于minifyEnabled,必须和minifyEnabled一起用。


Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.internal.widget.TintManager" on path: DexPathList[[zip file "/data/app/com.fivestar.finance.app-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]

添加依赖包

compile 'com.android.support:design:24.1.1'

GIT问题:error:src refspec master does not match any

将本地GIT版本库PUSH到一个GITHUB上一个空的版本库时可能会出现如下错误 error:src refspec master does not match any 原因: 本地版本库为空, 空目录不能提交 (只进行了init, 没有add和commit)


Android Studio类中实现Serializable自动生成serialVersionUID

1、File -> Settings… -> Editor -> Inspections -> Serialization issues[在java类目下] -> Serializable class without ‘serialVersionUID’(选中)

2、进入实现了Serializable中的类,选中类名,Alt+Enter弹出提示,然后直接导入完成

文/IF_I_WERE_A_BOY(简书作者) 原文链接:http://www.jianshu.com/p/c504857389d1 著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。


1.在写TextView 和ImageView 使用Selector切换字体颜色和图片的时候遇到定义的selector无效?

解决办法:textView字体颜色切换的selector最好写在res/color文件夹下,并且要在配置文件中添加clickable=”true” ImageView的图片切换也是要添加这个属性。如果没有添加这个属性,在代码中为相应的textView 和ImageView设置相应的事件监听也可达到效果, 这里建议添加clickable=”true”

在代码中为textView.setTextColor(a);a为Selector文件,不会产生效果。


Error:
Choreographer: Skipped 298 frames!  The application may be doing too much work on its main thread.

高德地图 mLocationOption.setOnceLocation(true); 改为-> mLocationOption.setOnceLocation(false);


android:singleLine=”true” sdk 23 后 过期被弃用 由 android:lines=”1” 取代,但部分手机无效,扔需设置前者


Android N 7.0 安装包解析失败问题

https://developer.android.com/about/versions/nougat/android-7.0-changes.html https://developer.android.google.cn/about/versions/nougat/android-7.0-changes.html

https://developer.android.google.cn/reference/android/support/v4/content/FileProvider.html

http://blog.csdn.net/henrychow_2015/article/details/54584905

启动安装页面的思路通常是往intent里面传递action个、flags、uri等参数,然后通过startActivity(Intent)的方式。7.0以前和7.0以后这些参数的配置就不太一样了。 7.0以前,配置action:Intent.setAction(Intent.ACTION_VIEW);配置flags:Intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);配置uri:Intent.setDataAndType(Uri.fromFile(问题1中的apkFile),”application/vnd.android.package-archive”)。 7.0以后,配置action:Intent.setAction(Intent.ACTION_INSTALL_PACKAGE);配置flags:Intent.setFlags(Intent.FLAG_GRANT_URI_PERMISSION);配置uri:Intent.setDataAndType(FileProvider.getUriForFile(context, “manifest中的provider,下面的例子会讲到”, 问题1中的apkFile),”application/vnd.android.package-archive”)。


All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.3.0, 24.0.0. Examples include com.android.support:support-v4:25.3.0 and com.android.support:support-v4:24.0.0

项目里(依赖或间接依赖)中包含不同版本包容易编译错误,需统一,support v7 appcompat等包依赖support-v4 ,解决办法添加 compile ‘com.android.support:support-v4:25.3.0’


IllegalArgumentException in CustomDatePicker                                                       java.lang.IllegalArgumentException: field android.widget.NumberPicker.mSelectionDivider has type android.graphics.drawable.Drawable, got java.lang.Integer

解决办法:long mindate = System.currentTimeMillis() - 1000L;
或者 initialDate = new Date(System.currentTimeMillis() - 1000L);


你可能感兴趣的:(android)