2017-08-31 87 views
1

這與反應母語反應,本地編譯錯誤:SDK構建工具版本太低項目

我不熟悉的編譯,所以任何幫助表示歡迎。

今天我無法編譯我的項目,因爲我花了很多時間和編譯工作,我嘗試更新反應包,但得到一個錯誤。所以我用git存儲(回滾)存儲項目並獲取以前的工作文件。我重新安裝node_modules,但出現了問題。我嘗試幾個小時,在文件中改變的版本,重新安裝軟件包

>react-native run-android 
    ... 
    What went wrong: 
    A problem occurred configuring project ':app'. 
    > Could not resolve all dependencies for configuration ':app:_debugApk'. 
    > A problem occurred configuring project ':react-native-image-crop-picker'. 
      > The SDK Build Tools revision (23.0.3) is too low for project ':react-native-image-crop-picker'. Minimum required is 25.0.0 

/myProject/android/build.gradle

buildscript { 
    repositories {   jcenter()  } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 
    } 
} ... 

/myProject/android/app/build.gradle

apply plugin: "com.android.application" 
... 
android { 
    compileSdkVersion 23 
    buildToolsVersion '25.0.0' 

    defaultConfig { 
     applicationId "com.iosreacttestplantnet2" 
     minSdkVersion 16 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
     ndk { 
      abiFilters "armeabi-v7a", "x86" 
     } 
     vectorDrawables.useSupportLibrary = true 
    } 
    splits { 
     abi { 
      reset() 
      enable enableSeparateBuildPerCPUArchitecture 
      universalApk false // If true, also generate a universal APK 
      include "armeabi-v7a", "x86" 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled enableProguardInReleaseBuilds 
      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 
     } 
    } 
    applicationVariants.all { variant -> 
     variant.outputs.each { output -> 
      def versionCodes = ["armeabi-v7a":1, "x86":2] 
      def abi = output.getFilter(OutputFile.ABI) 
      if (abi != null) { // null for the universal-debug, universal-release variants 
       output.versionCodeOverride = 
         versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 
      } 
     } 
    } 
} 

dependencies { 
    compile project(':react-native-vector-icons') 
    compile project(':react-native-maps') 
    compile project(':react-native-camera') 
    compile project(':react-native-image-crop-picker') 
    compile project(':react-native-exif') 
    compile project(':react-native-photo-view') 
    compile project(':react-native-i18n') 
    compile fileTree(dir: "libs", include: ["*.jar"]) 
    compile "com.android.support:appcompat-v7:23.0.1" 
    compile "com.facebook.react:react-native:+" // From node_modules 
} 
task copyDownloadableDepsToLibs(type: Copy) { 
    from configurations.compile 
    into 'libs' 
} 

MyProject/android/app/src/main

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.iosreacttestplantnet2" 
    android:versionCode="1" 
    android:versionName="1.0"> 

    <uses-permission android:name="android.permission.CAMERA"/> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-sdk 
     android:minSdkVersion="16" 
     android:targetSdkVersion="22" /> 

    <application 
     android:name=".MainApplication" 
     android:allowBackup="true" 
     android:label="@string/app_name" 
     android:icon="@mipmap/ic_launcher" 
     android:theme="@style/AppTheme"> 
     <meta-data 
     android:name="com.google.android.geo.API_KEY" 
     android:value="AIzaSyCGUcCxkCNyU9WBVYcGoTUexD-Xwlo2U4Q"/> 
     <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name" 
     android:configChanges="keyboard|keyboardHidden|orientation|screenSize" 
     android:windowSoftInputMode="adjustResize"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     </activity> 
     <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> 
    </application> 

</manifest> 

myProject的/的package.json

"react-native-image-crop-picker": "^0.14.2", 

回答

1

您可以從build.gradle文件中react-native-image-crop-picker的git的歷史看,從23compileSdkVersion & targetSdkVersion變化25於06月23日,所以你需要下載相應的Android SDK中製作react-native-image-crop-picker作品。

+0

我需要使它在Android 4.X上工作,所以我讓minSdkVersion 17 – AlainIb

相關問題