app:compileDebugJavaWithJavac task failing, erroring out on its own code - node.js

I'm getting this error after running npx react-native run-android, and I'm new to react and node in general so I'm not sure what could be going on.
gradle build --warning-mode all runs successfully with no issue. Not sure what could be going on. Running react-native upgrade doesn't help as suggested in similar questions, but it does give the error "Accessing non-existent property 'padLevels' of module exports inside circular dependency", though I think it's unrelated.
I'm on npm 6.14.10, node v14.15.4, Gradle 6.4, react-native-cli 2.0.1, react-native 0.63.4, openjdk 14.0.2
> Task :app:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.4/userguide/command_line_interface.html#sec:command_line_warnings
106 actionable tasks: 2 executed, 104 up-to-date
/android/app/src/main/java/com/test/MainApplication.java:20: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
/android/app/src/main/java/com/test/MainApplication.java:59: error: cannot find symbol
if (BuildConfig.DEBUG) {
^
symbol: variable BuildConfig
location: class MainApplication
/android/app/src/main/java/com/test/MainApplication.java:59: error: illegal parenthesized expression
if (BuildConfig.DEBUG) {
^
Note: /android/app/src/debug/java/com/test/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Related

Cargo add `Command failed due to unhandled error: reference 'refs/remotes/origin/master' not found`

I am getting
Command failed due to unhandled error: reference 'refs/remotes/origin/master' not found;
class=Reference (4); code=NotFound (-3)
when trying a cargo add.
I've removed ~/.cargo/registry and reinstalled via rustup but no luck. It's thrown when I do a cargo add flexbuffers but it's not limited to just that package - it doesn't work for others e.g. serde.
I had to:
mv ~/.cargo/registry/index/github.com-*/.git/refs/remotes/origin/HEAD \
~/.cargo/registry/index/github.com-*/.git/refs/remotes/origin/master
because of this issue.

How do I resolve errors for android studio code

Android Studio Error Log:
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:29.1.1.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.support:design:29.1.1.
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:29.1.1.
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.android.support:design:29.1.1.
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:29.1.1.
ERROR: Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve
This is simply because there is no Support library version 29.1.1 yet. The latest version is 28.0.0 see the Recent Support Library Revisions. You need to migrate to androidX to use the latest changes of Android support libraries.

Getting this error while running ionic code in Android studio - AGPBI: {"kind":"error","text":"No resource identifier found for attribute

I am working with Ionic project and I need to run this project with my android studio. I have resolved all the issues which are coming in the gradle file but when I am trying to run the code getting below error
error - No resource identifier found for attribute 'appComponentFactory' in package 'android'
enter image description here
above image is when I have fixed all the issue
but getting below error on runtime
**AGPBI: {"kind":"error","text":"No resource identifier found for attribute \u0027appComponentFactory\u0027 in package \u0027android\u0027","sources":[{"file":"/Users/naya-pc/Documents/Ionic/xyz/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml","position":{"startLine":57}}],"original":"","tool":"AAPT"}
/Users/naya-pc/Documents/Ionic/xyz/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:58: error: No resource identifier found for attribute 'appComponentFactory' in package 'android'
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt**
Also, I have tried the basic technique to resolve this type of issue
1. clean project
2. rebuild project
3. invalidate the cache and restart
but still getting the same issue.
I have changed almost every gradle file with the new one and old one but getting the same issue below are my gradle and they are working gradle.
compile "com.android.support:support-v4:22.0.0"
compile "com.android.support:appcompat-v7:22.0.0"
compile "com.facebook.android:facebook-android-sdk:4.+"
compile "com.google.gms:google-services:+"
compile "com.google.android.gms:play-services-tagmanager:+"
compile "com.google.firebase:firebase-core:+"
compile "com.google.firebase:firebase-messaging:+"
compile "com.google.firebase:firebase-crash:+"
compile "com.google.firebase:firebase-config:+"
compile "com.google.android.gms:play-services-base:15.0.1"
compile "com.google.android.gms:play-services-ads:15.0.1"
compile "com.google.android.gms:play-services-auth:15.0.1"
compile "com.google.android.gms:play-services-identity:15.0.1"
Please help me if you have any solution for this issue.

How do i fix this error of 'simple_permissions' on flutter?

There is an error when I run the code including simple_permissions on flutter project.
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
^
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:156: error: cannot find symbol
ActivityCompat.requestPermissions(activity, perm, 0);
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:163: error: cannot find symbol
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
^
symbol: variable ContextCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:171: error: cannot find symbol
if (ActivityCompat.shouldShowRequestPermissionRationale(registrar.activity(), permission)) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
C:\Users\ria\Downloads\flutter_windows_v1.2.1-stable\flutter\.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:175: error: cannot find symbol
if (ActivityCompat.checkSelfPermission(registrar.context(), permission) == PackageManager.PERMISSION_GRANTED) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':simple_permissions:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
*******************************************************************************************
I was getting the same issue, after some searches I found this repository.
https://github.com/tq-systems/simple_permissions
This repository solved the AndroidX compatibility issues.
import it into the pubspec.yaml like that:
dependencies:
simple_permissions:
git:
url: https://github.com/tq-systems/simple_permissions.git
I got the same issue. I solved it with these step
Step 1 => Update your android studio to lastest version
download here
Step 2
Uninstall your android studio and install the new with new setting
Step 3
Add the Flutter plugin
Step 4
Add this to your depences in build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath ('com.google.firebase:firebase-plugins:1.1.0') {
exclude group: 'com.google.guava', module: 'guava-jdk5'
}
}
Step 5
Run this command
flutter packages get
To update your packages and gradles
It worked fine for me.

Haxe: rebuild hxcpp failed with Error: Could not find build target "std"

Trying to rebuild hxcpp failed with the cryptic error message:
Error: Could not find build target "std"
Some users report this hint (I swear I didn't see it when I hit the issue, unless I'm just blind):
Have you tried rebuilding the hxcpp.n and build.n scripts?
This is done by running haxe in the tools/hxcpp and tools/build directories.
Hence:
cd hxcpp/tools/hxcpp
haxe compile.hxml
cd ../build
haxe compile.hxml
Fixes it.
Also note that nightly hxcpp builds are available from nmehost.com and openfl.org if you just need a newer version than what's available via haxelib.

Resources