Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process process = Runtime.getRuntime().exec(new String[]{javaExe, "-version"}) #1071

Closed
zhouzhi-zz opened this issue Jan 9, 2024 · 13 comments

Comments

@zhouzhi-zz
Copy link

Version

2.8.1

Platforms

dart

Device Model

mode flutter build apk -- debug

flutter info

flutter build apk

How to reproduce?

this

Logs

'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\permission_handler_android-10.3.6\android\build.gradle'.
[        ] > Configure project :photo_manager
[        ] Evaluating project ':photo_manager' using build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\photo_manager-2.8.1\android\build.gradle'.
[        ] Compiling build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\photo_manager-2.8.1\android\build.gradle' using SubsetScriptTransformer.
[   +1 ms] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\photo_manager-2.8.1\android\build.gradle' line: 36
[        ] * What went wrong:
[        ] Could not compile build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\photo_manager-2.8.1\android\build.gradle'.
[        ] > startup failed:
[        ]   build file 'C:\Users\Administrator\AppData\Local\Pub\Cache\hosted\pub.flutter-io.cn\photo_manager-2.8.1\android\build.gradle': 36: unexpected token: javaExe @ line 36,
column 62.
[        ]      etRuntime().exec(new String[]{javaExe, "
[        ]                                    ^
[        ]   1 error
[        ] * Try:
[        ] Run with --debug option to get more log output. Run with --scan to get full insights.

Example code (optional)

No response

Contact

No response

@paragasu
Copy link

i face the same issue when compiling

 flutter run                     
Using hardware rendering with device Android SDK built for arm64. If you notice graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for arm64 in debug mode...

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/phi/.pub-cache/hosted/pub.dev/photo_manager-2.8.1/android/build.gradle' line: 35

* What went wrong:
Could not compile build file '/Users/phi/.pub-cache/hosted/pub.dev/photo_manager-2.8.1/android/build.gradle'.
> startup failed:
  build file '/Users/phi/.pub-cache/hosted/pub.dev/photo_manager-2.8.1/android/build.gradle': 35: unexpected token: javaExe @ line 35, column 62.
     etRuntime().exec(new String[]{javaExe, "
                                   ^

  1 error


* 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
Running Gradle task 'assembleDebug'...                           1,960ms
Exception: Gradle task assembleDebug failed with exit code 1

@dingjianjaja
Copy link

Did it Solve?

@nbsikema
Copy link

@CaiJingLong

@AlexV525
Copy link
Member

AlexV525 commented Mar 3, 2024

Please attach the Flutter version and JDK version.

@daidaishuiping
Copy link

I have the same problem

@daidaishuiping
Copy link

2.13.0-0.1.pre • channel beta Dart 2.17.0

@CaiJingLong
Copy link
Member

Can you try to use 3.0.0 of photo_manager?

@CaiJingLong
Copy link
Member

Of course this issue should be fixed and I'll be looking for a better solution to trying to read the version number of java.
Until then, you can modify the gradle.properties file to temporarily solve the problem.

java.version=17

Optional values ​​are 1.8, 11, 17, 21

Documentation for this part of the configuration is here.
https://fluttercandies.github.io/flutter_photo_manager_plugins/photo_manager/gradle/java-version/

@daidaishuiping
Copy link

Of course this issue should be fixed and I'll be looking for a better solution to trying to read the version number of java. Until then, you can modify the gradle.properties file to temporarily solve the problem.

java.version=17

Optional values ​​are 1.8, 11, 17, 21

Documentation for this part of the configuration is here. https://fluttercandies.github.io/flutter_photo_manager_plugins/photo_manager/gradle/java-version/

I just tried it, and I got an error

@daidaishuiping
Copy link

1710062664451

1710062679988
1710062713451

@zhujianguo
Copy link

Me too

@yaochangliang159
Copy link

the same to me,can you solve this problem on android studio 2023.3.1????

@AlexV525
Copy link
Member

The method has been wrapped with error catching since v3.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants