Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 346 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flutter: Java uses or overrides a deprecated API

#1
I've been trying to use the auth, firestore firebase in an Android / IOS flutter application, and have been experiencing many different issues, after testing several different versions. Now it's showing me several messages in the build log.

build log


> Note:
> D:\Flutter\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.3+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java
> uses or overrides a deprecated API. Note: Recompile with
> -Xlint:deprecation for details. Note: D:\Flutter\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.13.0+1\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java
> uses unchecked or unsafe operations. Note: Recompile with
> -Xlint:unchecked for details. D8: Cannot fit requested classes in a single dex file (# methods: 81454 > 65536)
> com.android.builder.dexing.DexArchiveMergerException: Error while
> merging dex archives: The number of method references in a .dex file
> cannot exceed 64K. Learn how to resolve this issue at
>

[To see links please register here]

> at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:131)
> at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:118)
> at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
> at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:444)
> at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335)
> at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
> at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:47)
> at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
>
> at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
>
> at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
> at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
> at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
> at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
> at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
> at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
> at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
> at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:56)
>
> at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:215)
> at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:210)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
> at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
> at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
>
> at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
> at java.lang.Thread.run(Thread.java:748) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to
> complete
> at com.android.tools.r8.utils.t.a(:55)
> at com.android.tools.r8.D8.run(:11)
> at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:116)
> ... 34 more Caused by: com.android.tools.r8.utils.AbortException: Error: null, Cannot fit
> requested classes in a single dex file (# methods: 81454 > 65536)
> at com.android.tools.r8.utils.Reporter.a(:21)
> at com.android.tools.r8.utils.Reporter.a(:7)
> at com.android.tools.r8.dex.VirtualFile.a(:33)
> at com.android.tools.r8.dex.VirtualFile$h.a(:5)
> at com.android.tools.r8.dex.ApplicationWriter.a(:13)
> at com.android.tools.r8.dex.ApplicationWriter.write(:35)
> at com.android.tools.r8.D8.d(:44)
> at com.android.tools.r8.D8.b(:1)
> at com.android.tools.r8.utils.t.a(:23)
> ... 36 more
>
>
> FAILURE: Build failed with an exception.
>
> * What went wrong: Execution failed for task ':app:mergeDexDebug'.
> > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
> The number of method references in a .dex file cannot exceed 64K.
> Learn how to resolve this issue at

[To see links please register here]

>
> * 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

[To see links please register here]

>
> BUILD FAILED in 4m 33s


flutter doctor -v

> [√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows
> [Version 10.0.18362.535], locale en-IN)
>

- • Flutter version 1.12.13+hotfix.5 at D:\Flutter\SDK\flutter
> • Framework revision 27321ebbad (3 weeks ago), 2019-12-10 18:15:01 -0800
> • Engine revision 2994f7e1e6
> • Dart version 2.7.0

>
> [√] Android toolchain - develop for Android devices (Android SDK
> version 29.0.2)
>

- • Android SDK at C:\Users\admin\AppData\Local\Android\sdk
> • Android NDK location not configured (optional; useful for native profiling support)
> • Platform android-29, build-tools 29.0.2
> • Java binary at: D:\Android SDK\jre\bin\java
> • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
> • All Android licenses accepted.
>

> [√] Android Studio (version 3.5)
>

- • Android Studio at D:\Android SDK
> • Flutter plugin version 41.1.2
> • Dart plugin version 191.8593
> • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

pubspec

dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.15.3
cloud_firestore: ^0.13.0+1

build.gradle(android)



dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0'
}
Reply

#2
You need to use the following plugin:

```
dependencies:
firebase_auth: ^0.15.3
cloud_firestore: ^0.13.0+1
```

Don't forget to configure firebase:

[To see links please register here]


[To see links please register here]


Also in your `app/build.gradle`, increase the `minSdkVersion`:

Change this:

```
minSdkVersion 16
```

into this:

```
minSdkVersion 23
```
Reply

#3
In order to use **minSdkVersion** below 21 you will have to configure your app for multidex like this:

android {
defaultConfig {
...
minSdkVersion 15
targetSdkVersion 28
multiDexEnabled true
}
...
}

dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}

After this please run the

flutter pub upgrade
flutter pub get
flutter clean
flutter run

It will still throw the warning after **flutter clean**, but at least it will be possible for supporting earlier versions.
More to check out on [official docs][1]


[1]:

[To see links please register here]


Reply

#4
In my case, Open terminal and Run:
1. Run: flutter clean => Clean cache.
2. Run: flutter pub outdated => Findout what libraries need to upgrade.
3. Run: flutter pub upgrade => Upgrade libraries.
4. Run: flutter pub get.
5. Run: flutter run.

Good luck!
Reply

#5
I also got errors with my project when using Firebase services(core, auth, cloud firestore), but I decided to get into this problem only when building an appbundle:

[![screen with error in the console][1]][1]

fixed it with part of the chosen answer, by increasing **minSdkVersion** in *android/app/build.gradle*

from:

defaultConfig {
...
minSdkVersion 21
...
}

to:

defaultConfig {
...
minSdkVersion 23
...
}

Аnd then the error that I get of project building disappears:

[![enter image description here][2]][2]


[1]:

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through