Could not create task ':app:compileFlutterBuildDebug' - android-studio

Hello I'm getting this error
FAILURE: Build failed with an exception.
Where:
Script 'D:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 713
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not create task ':app:compileFlutterBuildDebug'.
> Must provide Flutter source directory
text
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
defaultConfig {
// Required by the Flutter WebView plugin.
minSdkVersion 21
}
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.food_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 20
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
manifestPlaceholders = [applicationName: "android.app.Application"]
}
debug {
manifestPlaceholders = [applicationName: "android.app.Application"]
}
build{
manifestPlaceholders = [applicationName: "android.app.Application"]
}
}
}
apply plugin: 'com.google.gms.google-services'
text 2

Related

No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir()

I'm getting this error
What went wrong:
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Could not create task ':app:packLibsflutterBuildDebug'.
> No signature of method: org.gradle.api.tasks.bundling.Jar.destinationDir() is applicable for argument types: (File) values: [/Users/amjadkhoulani/Downloads/food_app12amjad/build/app/intermediates/flutter/debug]
build.gradle
buildscript {
ext {
kotlin_version = '1.5.0'
}
repositories {
google()
jcenter()
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
defaultConfig {
// Required by the Flutter WebView plugin.
minSdkVersion 21
}
compileSdkVersion rootProject.ext.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.food_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 20
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
manifestPlaceholders = [applicationName: "android.app.Application"]
}
debug {
manifestPlaceholders = [applicationName: "android.app.Application"]
}
build{
manifestPlaceholders = [applicationName: "android.app.Application"]
}
}
}
app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
android {
compileSdk 33
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.abc.test"
minSdkVersion 21
targetSdkVersion 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'kotlin-android'
apply plugin: "kotlin-android-extensions"
androidExtensions {
experimental = true
}
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
flutter {
source '../..'
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:26.3.0')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'
implementation 'com.google.android.material:material:33'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
......................
This can happen if your gradle dependencies are out of date or out of sync.
android/build.gradle
Find the most recent, stable version of com.android.tools.build from here and update your dependencies:
dependencies {
...
classpath 'com.android.tools.build:gradle:7.4.1'
}
android/gradle/wrapper/gradle-wrapper.properties
Find the most recent stable version of Gradle from here and update the distribution URL.
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip

Unresolved reference everything when i create new jetpack compose project

i found some broke problem here, this is new project with default sample code I haven't do anything with the code then my android studio looks like in the image
I've try a lot of things including uninstalling android studio and re-installing this android studio, but I still found the same problem
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 31
defaultConfig {
applicationId "id.rizki.nidelist"
minSdk 23
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion '1.5.21'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}
You're not using the correct dependency versions. Most importantly, you are not using the correct version of Kotlin or Java:
In your project grade file use this:
buildscript {
ext {
compose_version = '1.1.0-beta01'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
}
}
In your app's gradle file:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.10'
}
apply from: 'codeinc.gradle'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 31
versionName "1.0"
//def yourVersionCode = getIncrementedVersionCode()
versionCode 1
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
useIR = true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion '1.5.31'
}
}
dependencies {
def lifecycle_version = '2.4.0'
def activity_version = '1.4.0'
def retrofit_version = "2.9.0"
def paging_version = '3.1.0-beta01'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.0-rc01'
implementation 'com.google.android.material:material:1.5.0-alpha05'
implementation "androidx.activity:activity-ktx:$activity_version"
implementation "androidx.activity:activity-compose:$activity_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0'
}

Flutter build error : Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'

I try to build apk in my flutter application. I am got one warning and one error. Warning message : Your Flutter application is created using an older version of the Android embedding. It's being deprecated in favor of Android embedding v2.
Error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: C:\Users\Abdulkadhar\Documents\Android\AppDevelopment\Production\simply2be_production\build\app\intermediates\flutter\debug\libs.jar.
> Transform's input file does not exist: C:\Users\Abdulkadhar\Documents\Android\AppDevelopment\Production\simply2be_production\build\app\intermediates\flutter\debug\libs.jar. (See https://issuetracker.google.com/issues/158753935)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4m 1s
Running Gradle task 'assembleRelease'... 243.1s (!)
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
My app gradle
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '2'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 29
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "app.projects.xxx.xxxx"
minSdkVersion 19
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
minifyEnabled true
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
flutter {
source '../..'
}
//apply plugin: 'com.android.application'
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.firebase:firebase-core'
}
apply plugin: 'com.google.gms.google-services'
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}}
My build gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'//4.0.0'//3.3.2 //3.5.3 //3.4.2
classpath 'com.google.gms:google-services:4.3.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
}
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}}
Here are my Gradle wrapper properties in case they are also important.
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
My gradle.properties
org.gradle.jvmargs=-Xmx1536m -Duser.country=US -Duser.language=en
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true

How to complete build.gradle file in Android Studio for a Flutter app deployment?

build.gradle_pic1
build.gradle_pic2
build.gradle_pic3
build.gradle_pic4
I am trying to generate an appbundle. I've got a key.jks file already ready to go. As far as I know, I've followed Flutter.dev/AndroidDeployment correctly? This is my first app deployment. Is manually changing the build.gradle file the best way to go? I know there's a UI structure element that has drop menus and such in Android Studio that I've tried to no success. Anyways, like I said, all I've done is follow Flutter.dev on Android deployment and now I'm stuck and I think my issue lies somewhere within build.gradle considering that it always shows red error lines under it. Can someone take a look at what I've got and lead me in the right direction? I've changed the private parts for obvious reasons.
Thanks!
Here is the code:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with
flutter.sdk in the local.properties file.")`
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.changed_text.techhelprelease"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
signingConfig signingConfigs.release
}
signingConfigs {
release {
keyAlias keystoreProperties['key']
keyPassword keystoreProperties['changedText']
storeFile keystoreProperties['C:\\changedText\\key.jks'] ? file(keystoreProperties['C:\\changedText\\key.jks']) : null
storePassword keystoreProperties['changedText']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
The problem was this:
signingConfigs {
release {
keyAlias keystoreProperties['key']
keyPassword keystoreProperties['changedText']
storeFile keystoreProperties['C:\\changedText\\key.jks'] ? file(keystoreProperties['C:\\changedText\\key.jks']) : null
storePassword keystoreProperties['changedText']
}
}
Should have stayed default from Flutter.dev, which is this:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
And then I figured out that I must have accidentally pasted the signature line where it didn't belong, which was throwing me an error every time. So this:
defaultConfig {
applicationId "com.changed_text.techhelprelease"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
signingConfig signingConfigs.release
}
Should not have the last line. Corrected:
defaultConfig {
applicationId "com.changed_text.techhelprelease"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
}

:app:compileDebugJava Failed when using android studio

In don't quite understand why this is failing to compile. When i compile and run the same source code from Eclipse, it compiles and runs perfectly fine. But under Android Studio and Gradle, it just falls apart.
Below is my build.gradle
apply plugin: 'android'
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
def versionBuild = 0
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
res.srcDirs = ['src/main/res']
jni.srcDirs = []
resources.srcDirs = ['src/main/res']
jniLibs.srcDirs = ['src/main/libs']
}
instrumentTest {
java.srcDirs = ['src/instrumentTest/java']
}
}
/*
productFlavors {
playstore {
packageName '<package name>'
}
amazonappstore {
packageName '<package name>'
}
samsungstore {
packageName '<package name>'
}
}*/
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
ndk{
abiFilter "all"
}
}
buildTypes {
//build type 3
release {
debuggable false
jniDebugBuild false
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
applicationVariants.all { variant ->
def file = variant.outputFile
variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
}
}
}
//TASKS
tasks.withType(com.android.build.gradle.tasks.PackageApplication){
pkgTask -> pkgTask.jniFolders = [new File(projectDir, "libs")]
}
task ndkBuild(type:Exec){
logger.info('ndkBuild Configuration')
def ndkBuild;
def ndkBuildingDir = new File("src/main");
def hasNdk = false;
logger.info('Project Path: ' +projectDir)
logger.info('JNI Path: ' +ndkBuildingDir)
if (System.env.ANDROID_NDK_HOME != null) {
hasNdk = true;
ndkBuild = new File(System.env.ANDROID_NDK_HOME, 'ndk-build')
}
else
{
//if env variable is not defined then do this
def Properties localProps = new Properties()
localProps.load(new FileInputStream(file('../local.properties')))
if (localProps['ndk.dir'] !=null)
{
hasNdk = true;
ndkBuild = new File(localProps['ndk.dir'], 'ndk-build')
}
}
commandLine ndkBuild, "--directory", ndkBuildingDir
doFirst {
if (!hasNdk) {
logger.error("Failed NDK build")
}
assert hasNdk : "ANDROID_NDK_HOME not set."
}
}
task copyNativeLibs(type: Copy, dependsOn: "ndkBuild") {
logger.error("Path is"+buildDir);
from(new File('src/main/libs')) { include '**/*.so' }
into new File(buildDir, 'native-libs')
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
}
dependencies {
compile 'com.android.support:support-v4:19.0.1'
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Here is few of the error messages
:app:ndkBuild
JNI LOCATION: jni
MAKE_FILE_LOCATION:
ZLIB Compiled
libpng compiling
make: Entering directory `/Users/vikramsahai/Documents/workspace/SVS-ANDROID/SVS/app/src/main'
Install : libharu.so => libs/armeabi/libharu.so
make: Leaving directory `/Users/vikramsahai/Documents/workspace/SVS-ANDROID/SVS/app/src/main'
:app:compileDebugJava
cast to Object for a varargs call
/Users/vikramsahai/Documents/workspace/SVS-ANDROID/SVS/app/src/main/java/com/vikramsahai/apps/finance/CPDF.java:255: error: cannot access Color
a1.setBackgroundColor(new BaseColor(0xD4D4D4));
^
class file for java.awt.Color not found
cast to Object[] for a non-varargs call and to suppress this warning
/app/src/main/java/com/vikramsahai/apps/finance/db/Database.java:329: warning: non-varargs call of varargs method with inexact argument type for last parameter;
initialValues.put(f.getName().substring(1, f.getName().length()), String.valueOf(m.invoke(obj, null)));
It doesn't make sense why it would compile and run on eclipse and yet fall apart on Android Studio/Gradle
The top level build.gradle has this dependency
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}

Resources