修复as热启动崩溃问题

pull/330/head
AriaLyy 8 years ago
parent 66f4a7e6ba
commit cd964d600e
  1. 2
      Aria/build.gradle
  2. 3
      Aria/src/main/java/com/arialyy/aria/orm/DbEntity.java
  3. 2
      Aria/src/main/java/com/arialyy/aria/orm/SqlHelper.java
  4. 2
      app/build.gradle
  5. 1
      build.gradle
  6. 4
      gradle/wrapper/gradle-wrapper.properties

@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion 23 compileSdkVersion 23
buildToolsVersion '25.0.2' buildToolsVersion '25.0.3'
defaultConfig { defaultConfig {
minSdkVersion 9 minSdkVersion 9

@ -161,8 +161,7 @@ public class DbEntity {
List<String> values = new ArrayList<>(); List<String> values = new ArrayList<>();
for (Field field : fields) { for (Field field : fields) {
field.setAccessible(true); field.setAccessible(true);
Ignore ignore = field.getAnnotation(Ignore.class); if (SqlHelper.ignoreField(field)) {
if (ignore != null && ignore.value()) {
continue; continue;
} }
where.add(field.getName()); where.add(field.getName());

@ -511,7 +511,7 @@ final class SqlHelper extends SQLiteOpenHelper {
* @return true 忽略该字段 * @return true 忽略该字段
*/ */
static boolean ignoreField(Field field) { static boolean ignoreField(Field field) {
// field.isSynthetic(), 使用as热启动App时,AS会自动给你的clss添加change字段 // field.isSynthetic(), 使用as热启动App时,AS会自动给你的class添加change字段
Ignore ignore = field.getAnnotation(Ignore.class); Ignore ignore = field.getAnnotation(Ignore.class);
int modifiers = field.getModifiers(); int modifiers = field.getModifiers();
return (ignore != null && ignore.value()) return (ignore != null && ignore.value())

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 23 compileSdkVersion 23
buildToolsVersion '25.0.2' buildToolsVersion '25.0.3'
defaultConfig { defaultConfig {
applicationId "com.arialyy.simple" applicationId "com.arialyy.simple"

@ -5,6 +5,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
// classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.android.tools.build:gradle:2.2.2'
// classpath 'com.novoda:bintray-release:0.5.0' // classpath 'com.novoda:bintray-release:0.5.0'
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7' // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'

@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip #distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

Loading…
Cancel
Save