Error in compile Android project via terminal with gradle 4.6 - android

My project today was updated to Gradle 4.6, before I used the following line to compile the project via Android Studio terminal:
./gradlew assembleDebug --configure-on-demand --daemon
Now an error occurs when I try to compile the project with that command. I have tried to read the documentation as shown in the output, but I can't find a topic about my particular problem.
Error log:
Task :app:compileTargetApi23DebugJavaWithJavac
error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
I appreciate any help in advance!

Error produced by Java 10, I uninstalled the JDK 10 and the compiler works again!

Related

Error of react-native-os and gradle versions in react-native project

So I'm using https://www.npmjs.com/package/#walletconnect/react-native-dapp library. The steps is clear I installed npx rn-nodeify --install --hack to have all important libraries for supporting wallet connect. And here is my "postinstall": "./node_modules/.bin/rn-nodeify --install 'crypto,buffer,react-native-randombytes,stream,os' --hack, patch-package". And of course os added react-native-os lib on my package.json too.
Project works perfectly on IOS but I got error running on android. Here is the error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Where:
Build file '/Users/name/Workspace/projectName/node_modules/react-native-os/android/build.gradle' line: 47
What went wrong:
A problem occurred evaluating project ':react-native-os'.
Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.ap
and here is the node_modules/react-native-os/android/build.gradle' line: 47 which I got error
46: dependencies {
47: compile 'com.facebook.react:react-native:+'
48: }
So I did a well research and find out that compile function has been deprecated since Gradle 4.10 (Aug 27, 2018), and were finally removed in Gradle 7.0 (Apr 9, 2021).
The aforementioned configurations should be replaced by implementation.
My project's gradle version is 7.2.1. And definitely I can't always go to react-native-os/android/build.gradle file and change the compile word to implementation!! And I can't downgrade my project's gradle version.
I tried to use patch-package lib which let me to modify files in node modules. But after that I see more deprecated stuff and errors. So what can I do?

Android Manifest doesn't exists or has incorrect root tag Error in Android Studio BumbleBee 2021.1.1 RC 1

I am using Android Studio BumbleBee 2021.1.1 RC 1
I Got this Error while I am running my project
(other project not showing any error like this.)
SCREEN SHOT :
Error : Android Manifest doesn't exists or has incorrect root tag
I had tried all the solutions , comment given in this link but not fixed :
(tried almost all solution in stack over flow)
Solution 1
Solution 2
Solution 3
--------------Solution That I tried---------------------
Sync project with Gradle files
Invalidate Caches and Restart....
Delete .gradle/.idea/ folder
Clean Project & Re-Build
Re-Created a new project and move all files to their. (tried as in case if manifest file corrupted)
Downgraded target sdk version to 30.
Upgrading/Downgrading Gradle version.
In AS terminal run
./gradlew clean assembleDebug (but still not fixed.)
I am attaching stacktrace by running ./gradlew build --stacktrace (which gives error details)
Task :app:compileReleaseJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for
details.
Task :app:minifyReleaseWithR8 AGPBI: {"kind":"warning","text":"Missing classes detected while running R8.
Please add the missing classes or apply additional keep rules that are
generated in D:\Android Project\DigiSchool BackUp\PlayStore\12 Aug
2021\EvvStudy\digi-schoo\app\build\outputs\mapping\release\missing_rules.txt.\n","sources":[{}]}
AGPBI: {"kind":"warning","text":"Missing class
kotlinx.coroutines.CoroutineScope (referenced from:
kotlinx.coroutines.CoroutineScope
id.zelory.compressor.Compressor$compress$3.p$ and 1 other
context)","sources":[{}],"tool":"R8"}
Task :app:lintDebug Wrote HTML report to file:///D:/Android%20Project/DigiSchool%20BackUp/PlayStore/12%20Aug%202021/EvvStudy/digi-schoo/app/build/reports/lint-results-debug.html
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 8.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
Still facing that issue please help me in to this.
I found the answer right now since I was facing the same issue without founding any solution.
On Android Studio go to:
File -> Project Structure (Ctrl+Alt+Maiusc+S) -> Facets -> Structure -> Manifest file:
Change the path of the file, the path is under
YOURAPPNAME\android\app\src\main

Trouble Installing Firebase Analytics to my React Native Android version

Ok so I believe I followed these instructions perfectly: https://rnfirebase.io/docs/v5.x.x/installation/android
1) After completing the instructions I get this error: Minimum supported Gradle version is 4.6. Current version is 4.4.
2) I go into gradle-wrapper.properties and change distributionUrl from
https\://services.gradle.org/distributions/gradle-4.4-all.zip
to
https\://services.gradle.org/distributions/gradle-4.6-all.zip
and re-synce
3) When I try to build after this I get the error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDevMinSdkDevKernelDebugResources'.
In the Java compiler I get the error:
/Users/DJarrin/Work/dev_envs/****/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:
uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.
I'm pretty lost and would really appreciate just some next steps to solve the issue.

"Could not initialize class" error running lint target from gradle

I'm working on an Android project with two projects inside it. When trying to run a build with gradlew (./gradlew build), I see the following error:
Execution failed for task ':example:lint'.
Could not initialize class
com.android.build.gradle.tasks.Lint$LintGradleIssueRegistry
With stacktrace enabled, this is listed as a java.lang.NoClassDefFoundError.
Oddly, the first time I ran this (which downloaded dependencies), the build failed with a different error:
Execution failed for task ':example:lint'.
lombok/ast/Node
The gradle wrapper that Android SDK created for the project is using Gradle 2.8.
Could this be a configuration issue with the project or my dev machine? I'm trying to avoid using the Android SDK lint tool as this complains about the projects using Gradle (and I hear it may miss some parts of these projects).
Turned out this was a configuration issue in our build.gradle. The following line had been added for testing and never removed:
configurations.classpath.exclude group: 'com.android.tools.external.lombok'
As such, the classes needed for linting were missing.
The following discussion pointed us in the right direction, in case it's useful to anyone else:
https://github.com/evant/gradle-retrolambda/issues/96

Android Studio does not compile when using deprecated API

I am having issues compiling and running my application on Android Studio.
The problem: It doesn't like that I am using deprecated APIs. (from gradlew compileDebug --stacktrace. Full stacktrace here
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
The Background:
I am using a PreferenceActivity which uses onPreferenceTreeClick and addPreferencesFromResource(int), both deprecated methods.
I am using ABS and ViewPager libraries, which both seem to also be using deprecated methods in their code.
The Question:
Can the run configurations be edited to an extend where It can compile succesfully despite of the deprecated APIs?
What can be changed/edited/modified to allow the build to compile succesfully?
Given that I plan on supporting pre-ICS devices and the usage of deprecated APIS shoudln't suppose a problem.
EDIT
So, the compiler from command prompt indicates the build was succesful, problem is running from Android Studio directly, the build process fails:
FAILURE: Build failed with an exception.
The problem seems to be something I have no idea how to fix, the popular line is:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:
which is happening at three different places:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Landroid/support/v4/app/ActivityCompatHoneycomb;
Landroid/support/v4/app/LoaderManager;
Here's some more info: Full Compiler output in Android Studio
* What went wrong:
Execution failed for task ':LaPrensa:dexDebug'.
> Running C:\Users\SkullKandy\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed.
You have simply to add this code to build.gradle (in android section)
lintOptions {
abortOnError false
}

Categories

Resources