Giter Club home page Giter Club logo

androidnote's Introduction

androidnote's People

Contributors

zhanzengyu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

androidnote's Issues

禁止 Activity 截图

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);

mac AndroidStudio 不能查看源码

如果 AndroidStudio 不能查看源码,并且 Download 之后还是一样。那么可以按照下面方式处理。

执行命令

cd ~/Library/Preferences/AndroidStudio3.4/options

进入配置目录。

其中我这里 AndroidStudio 版本为 3.4,如果你的版本为其他,上面的目录应该为 AndroidStudio 加上对应版本号。

然后编辑 jdk.table.xml。

里面有各个 SDK 版本的配置。

假设你 AndroidStudio 提示的是 27 有问题,你查找 27。

可以看到

<name value="Android API 27 Platform" />

往下可以看到下面

<sourcePath>
  <root type="composite">
  </root>
</sourcePath>

发现缺少源码路径配置,添加修改如下:

<sourcePath>
  <root type="composite">
    <root url="file://$USER_HOME$/Library/Android/sdk/sources/android-27" type="simple" />
  </root>
</sourcePath>

保存之后重启 AndroidStudio 应该就可以了。

参考:
Mac版Android Studio查看不到源码的解决方法

zsh git log 乱码

该方案是解决使用普通命令,比如 ls 显示中文文件夹没问题,但是 git log 查看 commit 信息中文乱码问题。

~/.zshrc 追加下面两行

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

然后执行 source ~/.zshrc 让配置生效即可

AndroidStudio logcat 正则无法过滤

需要注意正则要使用空格来隔开,这边发现没有空格会有问题
& 只需要空格
| 需要前后空格加 |
所以如果你想过滤自己的应用程序,使用

package:mine

如果还要在此基础上筛选出 A,则是

package:mine A

如果希望还要筛选出 B,则是

package:mine A | B

注意空格的使用,没有空格,比如下面,可能就什么都筛选不出来

package:mineA|B

Plugin [id: 'com.android.application', version: '7.4.2', apply: false] was not found in any of the following sources:

add codes as follows:

maven { url 'https://jitpack.io' }
// 阿里云镜像
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }

change before:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

after:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://jitpack.io' }
        //阿里云镜像
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        //阿里云镜像
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
    }
}

jenkins error and solution

There are some bug when we build android project with gradle, now give some solutions follow.

Q1:

ProGuard, version 5.2.1
Reading input...
Execution failed for task 'project:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first.

A1:

disable the ProGuard first.
check you module build.gradle, make the minifyEnabled's value to be false.
minifyEnabled false

Q2:

Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: aidl is missing

A2:

it means you compileSdkVersion and buildToolsVersion is not very fit.
I am use 25 and 25.0.0 and get this error.Then I instead of 23 and 23.0.2.And this error is solve.

Q3:

Caused by: org.gradle.api.InvalidUserDataException: File 'project/module/build/intermediates/res/
		resources-release-stripped.ap_' specified for property 'resourceFile' does not exist.

A3:

set shrinkResources's value to be false
shrinkResources false

Q4:

Caused by: org.gradle.api.GradleException: Buildtools 25.0.0 requires Java 1.8 or above.  Current JDK version is 1.7.
		or other show your jdk is not fit

A4:

in jenkins,change the task from
assemble --stacktrace
to
assemble --stacktrace -Dorg.gradle.java.home='yourjdkhome'

Q5:

Caused by: java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

A5:

check your gradle version and jdk version.mostly it's your jdk version.You can try the Q4 solution and see whether it solve or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.