react-native package android.support.v4.media does not exist - android-support-library

I am using react-native 0.57.1
react-native track player 0.2.5
I have got following error:
C:\zzzprojects\app\node_modules\react-native-track-player\android\src\main\java\guichaguri\trackplayer\metadata\Metadata.java:9:
error: package android.support.v4.media does not exist import
android.support.v4.media.MediaMetadataCompat;
^
C:\zzzprojects\app\node_modules\react-native-track-player\android\src\main\java\guichaguri\trackplayer\metadata\Metadata.java:10:
error: package android.support.v4.media does not exist import
android.support.v4.media.RatingCompat;
^
C:\zzzprojects\app\node_modules\react-native-track-player\android\src\main\java\guichaguri\trackplayer\metadata\Metadata.java:11:
error: package android.support.v4.media.session does not exist import
android.support.v4.media.session.MediaButtonReceiver;
^
C:\zzzprojects\app\node_modules\react-native-track-player\android\src\main\java\guichaguri\trackplayer\metadata\Metadata.java:12:
error: package android.support.v4.media.session does not exist import
android.support.v4.media.session.MediaControllerCompat;
^
...........
...........
..........
C:\zzzprojects\app\node_modules\react-native-track-player\android\src\main\java\guichaguri\trackplayer\metadata\components\CustomVolume.java:14:
error: cannot find symbol super(canControl ? VOLUME_CONTROL_ABSOLUTE :
VOLUME_CONTROL_FIXED, maxVolume, (int)(volume * maxVolume));
^
symbol: variable VOLUME_CONTROL_ABSOLUTE
location: class CustomVolume
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
100 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-track-player: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 43s
36 actionable tasks: 25 executed, 11 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
I have tried a lot of methods I even init a new project and just install react native it is giving same error again .
...
thanks.
do answer me soon

Related

Deploying KotlinJs React web app to Heroku, error extracting tar content of undefined failed

I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get the following error
> Task :common:root:jsPackageJson
> Task :web-app:packageJson
> Task :web-app:testPackageJson
> Task :rootPackageJson
> Task :kotlinNpmInstall
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/LICENSE'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/data/features/getcomputedstyle.js'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall FAILED
> Task :kotlinNpmInstall FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':firebase-kotlin-sdk:kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* 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 5m 20s
18 actionable tasks: 18 executed
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
Tried running kotlinNpmInstall locally on both the library and the whole project and it works properly, with no failures.
While I do not know the exact cause, it seems that multiple yarn process are spawned that corrupt each other's packages.
This can be solved with the mutex option.
To add yarn options to a kotlin/js project you can add a .yarnrc file to the root of your project.
My .yarnrc's content:
--install.mutex network
This makes yarn use a predefined port on the network for its mutex.

Execution failed for task ':app:processDebugResources'.1

I clearly have no clue why it shows this error. All solutions are appreciated.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
Output: W/ziparchive( 9548): Unable to open 'C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar': No such file or directory
error: failed to open APK: I/O error.
Command: C:\Users\admin.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\c8dfbdcc79a1dd8c0cb75349d60f6c77\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
C:\Users\admin\AppData\Local\Android\sdk\platforms\android-28\android.jar\
--manifest\
C:\Users\gaurav\tutorial\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\gaurav\tutorial\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
#C:\Users\gaurav\tutorial\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\gaurav\tutorial\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.example.tutorial\
-0\
apk\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
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 22s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/androidx-migration for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
Update you sdk version to 28. Edit the file build.gradle and change property compileSdkVersion up to 28.

How to fix a diagnostic error in flutter?

When I run the application gradle is failing to build
Compiler message:
file:///C:/Users/Wellick/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_sticky_header-0.3.4/lib/src/widgets/sticky_header_layout_builder.dart:147:16:
Error: The argument type 'String' can't be assigned to the parameter
type 'DiagnosticsNode'.
- 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart'
('file:///C:/Users/Wellick/Documents/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
Try changing the type of the parameter, or casting the argument to
'DiagnosticsNode'.
context: context);
^ Compiler failed on C:\Users\Wellick\Desktop\flutter\rapidinho-master\lib\main.dart
FAILURE: Build failed with an exception.
Where: Script 'C:\Users\Wellick\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle'
line: 665
What went wrong: Execution failed for task ':app:compileflutterBuildDebugArm'.
Process 'command 'C:\Users\Wellick\Documents\flutter\bin\flutter.bat'' finished with
non-zero exit value 1
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 24s Finished with error: Gradle task assembleDebug
failed with exit code 1
It seems that this issue was due to the previous version 0.3.4 to be exact, the issue was reported in GitHub and the fix is to upgrade the version to 0.4.0. Currently, the latest version 0.5.0 is more stable than the previous versions.

Flutter Assemble debug linkng error app will not compile, tried everything

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
Output: /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:905: error: resource android:attr/fontVariationSettings not found.
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:905: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /home/ollie2224/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/5495ad1b91b297bb4c274b380506e4f6/aapt2-3.2.1-4818971-linux/aapt2 link -I\
/home/ollie2224/Android/Sdk/platforms/android-26/android.jar\
--manifest\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/home/ollie2224/StudioProjects/24Hrs/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.rookieplays.tf\
-0\
apk\
--output-text-symbols\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0
Output: /home/ollie2224/.gradle/caches/transforms-1/files-1.1/appcompat-1.0.0.aar/7ffba96d1618b0c08b4da202d0eddb85/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.
/home/ollie2224/.gradle/caches/transforms-1/files-1.1/core-1.0.0.aar/21a52465ad0e625487952f3012c37e7c/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/home/ollie2224/.gradle/caches/transforms-1/files-1.1/core-1.0.0.aar/21a52465ad0e625487952f3012c37e7c/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: /home/ollie2224/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/5495ad1b91b297bb4c274b380506e4f6/aapt2-3.2.1-4818971-linux/aapt2 link -I\
/home/ollie2224/Android/Sdk/platforms/android-26/android.jar\
--manifest\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/home/ollie2224/StudioProjects/24Hrs/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--custom-package\
com.rookieplays.tf\
-0\
apk\
--output-text-symbols\
/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/symbols/debug/R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0
* 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 31s
Finished with error: Gradle task assembleDebug failed with exit code 1
This looks like https://github.com/flutter/flutter/issues/27106
You probably updated to newest plugins but didn't migrate to AndroidX yet, which is required for the newest plugin versions.
For more details see https://github.com/flutter/flutter/issues/27128#issuecomment-458274311
https://developer.android.com/jetpack/androidx/migrate
With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.
For that to work you need to open the android/ directory of your project directly https://flutter.io/docs/development/tools/android-studio#android-ide

NativeScript UI Autocomplete don't compiled

In my nativescript app, I have a problem about using nativescript ui autocomplete. I compile my mobile application to android apps. It has an error as below
<======-------> 50% CONFIGURING [3s]
<====---------> 35% EXECUTING [13s]
<======-------> 51% EXECUTING [20s]
Exception in thread "main" java.lang.ClassNotFoundException: Class: com.telerik.widget.autocomplete.ShowSuggestionListListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:776)
at org.nativescript.staticbindinggenerator.Generator.collectInterfaceMethods(Generator.java:703)
at org.nativescript.staticbindinggenerator.Generator.getPublicApi(Generator.java:227)und 0 errors. Watching for file changes.
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:342)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:133)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:172)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:90)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:66)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:runSbg'.
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
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 25s
10:34:24 - Found 0 errors. Watching for file changes.
Unable to apply changes on device: 192.168.80.101:5555. Error is: Command ./gradlew failed with exit code 1.
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from /home/andre/nativescript/TigaRoda/hooks/after-watch/nativescript-dev-webpack.js
Stopping webpack watch
delete node_modules, platforms, hooks folders and package-lock.json file
run
npm i
rebuild the project ->
tns run android
or
tns build android

Resources