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

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

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.

Execution failed for task ':app:processDebugResources'. > Android resource linking failed can longer build RN android version

The android version of my React native app now refuses to build. I have updated the compiledSKD version to 28 as suggested in this post.
This is the error I get when I attempt to build on a physical device:
What went wrong: Execution failed for task ':app:processDebugResources'.
Android resource linking failed Output: /Users/someguy/projects/third/someapp/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:422:
error: resource android:attr/fontVariationSettings not found.
/Users/someguy/projects/third/someapp/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:422:
error: resource android:attr/ttcIndex not found. error: failed
linking references.
Command: /Users/someguy/.gradle/caches/transforms-1/files-1.1/aapt2-3.5.0-alpha03-5252756-osx.jar/d3ea99fc2d1356bcc9bc022a544dfd8b/aapt2-3.5.0-alpha03-5252756-osx/aapt2
link -I\
/Users/someguy/Library/Android/sdk/platforms/android-26/android.jar\
--manifest\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/Users/someguy/projects/third/someapp/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/Users/someguy/projects/third/someapp/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--proguard-main-dex\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/legacy_multidex_aapt_derived_proguard_rules/debug/processDebugResources/manifest_keep.txt\
--custom-package\
com.someapp\
-0\
apk\
--output-text-symbols\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors Daemon: AAPT2 aapt2-3.5.0-alpha03-5252756-osx Daemon #0 Output:
/Users/someguy/.gradle/caches/transforms-1/files-1.1/drawee-1.3.0.aar/cdd2e6e5cf23d268c647bf7bca6ef749/res/values/values.xml:3:5-53:675:
AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/someguy/.gradle/caches/transforms-1/files-1.1/drawee-1.3.0.aar/cdd2e6e5cf23d268c647bf7bca6ef749/res/values/values.xml:3:5-53:675:
AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references. Command: /Users/someguy/.gradle/caches/transforms-1/files-1.1/aapt2-3.5.0-alpha03-5252756-osx.jar/d3ea99fc2d1356bcc9bc022a544dfd8b/aapt2-3.5.0-alpha03-5252756-osx/aapt2
link -I\
/Users/someguy/Library/Android/sdk/platforms/android-26/android.jar\
--manifest\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
-o\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
-R\
#/Users/someguy/projects/third/someapp/android/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
/Users/someguy/projects/third/someapp/android/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
--proguard-main-dex\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/legacy_multidex_aapt_derived_proguard_rules/debug/processDebugResources/manifest_keep.txt\
--custom-package\
com.someapp\
-0\
apk\
--output-text-symbols\
/Users/someguy/projects/third/someapp/android/app/build/intermediates/symbols/debug/R.txt\
--no-version-vectors Daemon: AAPT2 aapt2-3.5.0-alpha03-5252756-osx 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 5s 133 actionable tasks: 2 executed, 131 up-to-date
I've also double checked my AndroidManifest.xml file to see if I have any hanging brackets as suggested in this post
Did you run the bundle command?
sudo react-native bundle --platform android --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --dev false --reset-cache --assets-dest android/app/src/main/res/
And close the existing packager and re-open packager.
I resolved this issue by adding androidXCore="1.6.0" in myApp/android/build.gradle to look like this
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
androidXCore="1.6.0"

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

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

:makestart fails when setting up DecompWorkspace in Minecraft Forge Gradle; multiple errors in openeing .zip files

When setting up the Forge DecompWorkspace, it crashes when creating the :makestart. Any help? Below is my output when run.
Thanks.
P.S. I have tried running it with --refresh-dependencies, but still no luck. Also, Java 7 and its JDK are installed completely and correctly.
C:\Minecraft\1.7\Project>gradlew setupDevWorkspace --refresh-dependencies
****************************
Powered By MCP:
http://mcp.ocean-labs.de/
Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
MCP Data version : unknown
****************************
:downloadClient SKIPPED
:downloadServer SKIPPED
:getVersionJson
:extractUserDev UP-TO-DATE
:mergeJars SKIPPED
:applyBinPatches SKIPPED
:downloadMcpTools SKIPPED
:extractMcpData UP-TO-DATE
:genSrgs SKIPPED
:deobfBinJar SKIPPED
:extractNatives UP-TO-DATE
:getAssetsIndex
:getAssets
:makeStart
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\tv.twitch\twitch-external-platform\4.5\c3cde57891b935d41b6680a9c5e1502
eeab76d86\twitch-external-platform-4.5-natives-windows-64.jar; error in opening
zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.1\aa9aae879af8eb378e22cfc64db56ec2c
a9a44d1\lwjgl-platform-2.9.1-natives-linux.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.1\2d12c83fdfbc04ecabf02c7bc8cc54d03
4f0daac\lwjgl-platform-2.9.1-natives-osx.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\com.google.guava\guava\17.0\9c6ef172e8de35fd8d4d8783e4821e57cdef7445\g
uava-17.0.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.apache.commons\commons-lang3\3.3.2\90a3822c38ec8c996e84c16a3477ef6
32cbc87a3\commons-lang3-3.3.2.jar; error in opening zip file
[ant:javac] 5 errors
:makeStart FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':makeStart'.
> Compile 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.
BUILD FAILED
Total time: 2 mins 10.551 secs
C:\Minecraft\1.7\Project>gradlew --refresh-dependencies setupDevWorkspace idea
****************************
Powered By MCP:
http://mcp.ocean-labs.de/
Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
MCP Data version : unknown
****************************
:downloadClient SKIPPED
:downloadServer SKIPPED
:getVersionJson
:extractUserDev UP-TO-DATE
:mergeJars SKIPPED
:applyBinPatches SKIPPED
:downloadMcpTools SKIPPED
:extractMcpData UP-TO-DATE
:genSrgs SKIPPED
:deobfBinJar SKIPPED
:extractNatives UP-TO-DATE
:getAssetsIndex
:getAssets
:makeStart
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\tv.twitch\twitch-external-platform\4.5\c3cde57891b935d41b6680a9c5e1502
eeab76d86\twitch-external-platform-4.5-natives-windows-64.jar; error in opening
zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.1\aa9aae879af8eb378e22cfc64db56ec2c
a9a44d1\lwjgl-platform-2.9.1-natives-linux.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.lwjgl.lwjgl\lwjgl-platform\2.9.1\2d12c83fdfbc04ecabf02c7bc8cc54d03
4f0daac\lwjgl-platform-2.9.1-natives-osx.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\com.google.guava\guava\17.0\9c6ef172e8de35fd8d4d8783e4821e57cdef7445\g
uava-17.0.jar; error in opening zip file
[ant:javac] error: error reading C:\Users\redgames1234\.gradle\caches\modules-2\
files-2.1\org.apache.commons\commons-lang3\3.3.2\90a3822c38ec8c996e84c16a3477ef6
32cbc87a3\commons-lang3-3.3.2.jar; error in opening zip file
[ant:javac] 5 errors
:makeStart FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':makeStart'.
> Compile 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.
BUILD FAILED
Total time: 2 mins 46.544 secs
C:\Minecraft\1.7\Project>

Resources