在android studio中添加system权限:



点击(此处)折叠或打开

  1. apply plugin: 'com.android.application'

  2. android {
  3.     compileSdkVersion 24
  4.     buildToolsVersion "24.0.2"
  5.     defaultConfig {
  6.         applicationId "com.whiteskycn.hitool"
  7.         minSdkVersion 16
  8.         targetSdkVersion 24
  9.         versionCode 1
  10.         versionName "1.0"
  11.         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  12.     }
  13.     buildTypes {
  14.         release {
  15.             minifyEnabled false
  16.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  17.         }
  18.     }
  19. }

  20. dependencies {
  21.     compile fileTree(dir: 'libs', include: ['*.jar'])
  22.     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  23.         exclude group: 'com.android.support', module: 'support-annotations'
  24.     })
  25.     compile 'com.android.support:appcompat-v7:24.2.1'
  26.     testCompile 'junit:junit:4.12'
  27.     provided files(getLayoutLibPath())
  28. }


  29. /** get layoutlib.jar path.
  30.  * android.os.SystemProperties need it. */
  31. // must called after "android" definition
  32. def getLayoutLibPath() {
  33.     return "${android.getSdkDirectory().getAbsolutePath()}" + "/platforms/" +
  34.             android.compileSdkVersion + "/data/layoutlib.jar"
  35. }

10-14 07:04