for input string:"" in build.gradle on apple M1 - android

When I run my app use jdk_x86(jdk1.8.0_321.jdk), I can build success, but when I use jdk_arm(zulu-8.jdk), gradle sync error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/test/Work/Test/AlbumList/library/build.gradle' line: 29
* What went wrong:
A problem occurred evaluating project ':library'.
> For input string: ""
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
the build gradle:
29:def revisionNumber = 'git rev-list HEAD --count'.execute().getText().trim().toInteger()
I find 'git rev-list HEAD --count' run in a error path, not run in current project path.

Check if you have gradle wrapper version 7.0+
I lost quite some time testing several M1 JDK distros and all presented the same behavior.
Turns out Gradle only added support to M1 on this version thus the error you're seeing

Related

the probleem in flutter it is occcoureed when i try to make run

when io try to mak run on phone in flutter it always show me this
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\3mrxc\OneDrive\��� ������\flutter_application_1\android\app\build.gradle' line: 23
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.
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
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
if someone the solution I will be thankfull

FAILURE: Build failed with an exception. * Where: Build file '/Users/rajeevyadav/Downloads/sevendaystraventure/android/app/build.gradle' line: 58

What went wrong:
A problem occurred evaluating project ':app'.
Cannot convert URL 'C:/Users/HP/key.jks' to a file.[The plugin ext_storage uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
FAILURE: Build failed with an exception.
Where:
Build file '/Users/rajeevyadav/Downloads/sevendaystraventure/android/app/build.gradle' line: 58
What went wrong:
A problem occurred evaluating project ':app'.
Cannot convert URL 'C:/Users/HP/key.jks' to a file.
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 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
]1
make sure that the key.jks file is in the correct directory

Trying to generate APK for a flutter app but the bugs below keeps coming up

Trying to Build the android APK for a flutter app and these bugs keeps coming up
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForRelease'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete
* 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 22m 24s
Running Gradle task 'assembleRelease'... 1358.6s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin agora_rtc_engine...
Running Gradle task 'assembleAarRelease'... 1096.7s (!)
Downloading https://services.gradle.org/distributions/gradle-4.6-all.zip
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'agora_rtc_engine'.
Unzipping C:\Users\me\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg\gradle-4.6-all.zip to C:\Users\me\.gradle\wrapper\dists\gradle-4.6-all\bcst21l2brirad8k2ben1letg
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
* Try:
The current default is 'false'
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.
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
* Get more help at https://help.gradle.org
BUILD FAILED in 18m 12s
The plugin agora_rtc_engine could not be built due to the issue above.
When I run the code, it works fine. So I am assuming that the problem is not with the code. so what can be wrong that makes it unable to build apk
Formally the sdk directory was like this sdk.dir=C:\\Users\\me\\AppData\\Local\\Android\\Sdk but then I changed it to what is below by the inclusion of "\" in front of the "C" the Flutter build APK is not responding
Here is my local.properties
sdk.dir=C\:\\Users\\me\\AppData\\Local\\Android\\Sdk
flutter.sdk=C\:\\src\\flutter
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1
Here is my settings.gradle
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
Now when I Click the the Build APK, the Android studio is not responding(i.e trying to build the APK) and when it does try to build APK its brings out these bugs, I have checked the questions that looks similar to this and tried the solutions which is sdk.dir but the bug still remained unfixed

React Native CLI failed to determine Android project configuration

I'm trying to build my android project but I'm facing a configuration error.
Previously I built an app bundle, but after that, I'm receiving the following error.
I already deleted node_nodules and tried "yarn install" but the error persist.
D:\ReactNative\Mapin\android>gradlew assembleRelease
Starting a Gradle Daemon, 10 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Script 'D:\ReactNative\Mapin\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 206
* What went wrong:
A problem occurred evaluating script.
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
[root:D:\ReactNative\Mapin\android, reactNativePath:D:\ReactNative\Mapin\node_modules\react-native, dependencies:[:], commands:[], assets:[], platforms:[:], haste:[providesModuleNodeModules:[], platforms:[]], project:[:]]
* 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 15s
Fixed follow the following:
yarn add #react-native-community/cli-platform-android#3.0.3
yarn add react-native#0.61.5
Removed "--quiet" from npx.cmd in native_modules.gradle
cd android && gradlew clean
native_modules.gradle can be found in:
${PROJECT_FOLDER}/node_modules/#react-native-community/cli-platform-android/native_modules.gradle

OSX Gradle too old

Anyways I installed gradle and when I run terminal to compile the app, it says
Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "30ea056c59524902d1004bd520624b7571f1ad77"
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/Test/Desktop/PieMessage/PieMessage-Android/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Could not create plugin of type 'AppPlugin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I would prefer not to use android studio or intellij because they are not letting me run the class for some reason, the RUN option is greyed out, only the RUN.. is available and that leads to debug.

Categories

Resources