react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Android Build failed when we are using gradle system 6.5 with android gradle plugin 4.0.0.

Open mathankumarinspirisys opened this issue 6 years ago • 8 comments

Task :react-native-background-geolocation:bundleDebugAar FAILED

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error).

mathankumarinspirisys avatar Jun 12 '20 17:06 mathankumarinspirisys

Yes, I’m aware. Fix coming soon. In the meantime, don’t use gradle tools @ 4.0.0.

christocracy avatar Jun 12 '20 18:06 christocracy

Yes, I’m aware. Fix coming soon. In the meantime, don’t use gradle tools @ 4.0.0. Hi @christocracy - any updates on the timing of the release for gradle tools @4.0.0? Thanks so much for your support here.

ResoltzDeveloper avatar Jul 12 '20 23:07 ResoltzDeveloper

Yes, this was fixed in the private repo already in 3.8.0. This is why customers should switch to using the private repo, for access to latest updates.

The public repo here gets updates only about every 3 months.

christocracy avatar Jul 12 '20 23:07 christocracy

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':background_fetch:bundleDebugAar'.

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :background_fetch project caused this error: C:\Users\pc\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\background_fetch-0.5.6\android\libs\tsbackgroundfetch-0.4.5.aar

[√] Flutter (Channel master, 1.21.0-2.0.pre.66, on Microsoft Windows [Version 10.0.18363.959], locale en-US) • Flutter version 1.21.0-2.0.pre.66 at C:\flutter • Framework revision 54c9441723 (3 days ago), 2020-07-17 18:56:12 -0400 • Engine revision d327828632 • Dart version 2.9.0 (build 2.9.0-21.0.dev 9dca49e71e)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1) • Android SDK at C:/Users/pc/AppData/Local/Android/Sdk • Platform android-30, build-tools 30.0.1 • ANDROID_HOME = C:/Users/pc/AppData/Local/Android/Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted.

[√] Android Studio (version 4.0) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 47.1.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available) • SM G530H (mobile) • 1b13d5a3 • android-arm • Android 5.0.2 (API 21)

• No issues found! Process finished with exit code 0

<application android:name=".Application"

import io.flutter.app.FlutterApplication; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugin.common.PluginRegistry; import io.flutter.plugins.GeneratedPluginRegistrant; public class Application extends FlutterApplication implements PluginRegistry.PluginRegistrantCallback { @Override public void onCreate() { super.onCreate(); BackgroundFetchPlugin.setPluginRegistrant(this); }

@Override
public void registerWith(PluginRegistry registry) {
    GeneratedPluginRegistrant.registerWith((FlutterEngine) registry);
}

public class MainActivity extends FlutterActivity { @Override public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); } } }

buildscript {

ext.kotlin_version = '1.3.72'
ext {
    kotlin_version     = '1.3.72'
    compileSdkVersion   = 29
    targetSdkVersion    = 29
    appCompatVersion    = "1.0.0"
    playServicesLocationVersion = "17.0.0"
    removeBackgroundGeolocationDebugSoundsInRelease = false
}

repositories {
    google()
    jcenter()
}
ext.kotlin_version = '1.3.72'

dependencies {
    classpath 'com.android.tools.build:gradle:4.0.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

}

s2yed avatar Jul 20 '20 12:07 s2yed

@s2yed You are using Flutter. This repo is the React Native version.

christocracy avatar Jul 20 '20 12:07 christocracy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale[bot] avatar Sep 18 '20 17:09 stale[bot]

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

stale[bot] avatar Sep 26 '20 10:09 stale[bot]

Any fix for this issue yet?

ankitmhn avatar Nov 11 '20 04:11 ankitmhn