-1

This question asked many times in S.O, However, none of them helped me, because I accepted license in command line.

I am new in react and android. I have installed android studio and it's packages. I init the react, but it complains about licenses.

build.gradle:

apply plugin: "com.android.application"

import com.android.build.OutputFile



project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"


def enableProguardInReleaseBuilds = false

android {
     compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com...."
         minSdkVersion 25
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false
            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 fileTree(dir: "libs", include: ["*.jar"])
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile "com.facebook.react:react-native:+"  // From node_modules
}

task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

When I run

react-native run-android

The result is:

You have not accepted the licenses arguments

I used the command line and accepted the licenses(S.O)

All SDK package licenses accepted.

however, it complains about licenses again.

Amir Shabani
  • 690
  • 2
  • 14
  • 36
  • Possible duplicate of [You have not accepted the license agreements.\[Android SDK Platform 23\]](https://stackoverflow.com/questions/45364498/you-have-not-accepted-the-license-agreements-android-sdk-platform-23) – AesSedai101 Jan 11 '18 at 09:18
  • @AesSedai101 I used the command line and accepted the licenses. please see the last image in my question – Amir Shabani Jan 11 '18 at 10:43

1 Answers1

0

Wrong JAVA_PATH can cause this error too. I registered a wrong java_path into environment variables. After changing it to right path, everything works like a charm.

Amir Shabani
  • 690
  • 2
  • 14
  • 36