一个问题发生评估项目“:应用程序”。 >路径可能不为空值或空字符串。路径=“空”

问题描述 投票:1回答:1

我面对错误,而我试图运行扑。

 D:\fluttapp\testbuild>flutter run
Launching lib/main.dart on Google Pixel 2 XL in debug mode...
Initializing gradle...                                       2.1s
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "D:\fluttapp\testbuild\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\fluttapp\testbuild\android\app\build.gradle' line: 57

* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path='null'

* 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 6s
  Command: D:\fluttapp\testbuild\android\gradlew.bat app:properties


Please review your Gradle project setup in the android/ folder.

D:\fluttapp\testbuild>flutter doctor -v
[√] Flutter (Channel beta, v1.1.8, on Microsoft Windows [Version 10.0.17134.556], locale
    en-IN)
    • Flutter version 1.1.8 at D:\flutter
    • Framework revision 985ccb6d14 (3 weeks ago), 2019-01-08 13:45:55 -0800
    • Engine revision 7112b72cc2
    • Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at D:\Users\Bhanu\AppData\Local
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = D:\Users\Bhanu\AppData\Local
    • Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at D:\Program Files\Android\Android Studio
    • Flutter plugin version 29.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] Connected device (1 available)
    • Google Pixel 2 XL • 192.168.50.101:5555 • android-x86 • Android 9 (API 28)

• No issues found!

我这里补充回购。我已经采取了样本代码,以使发布的应用程序版本,但无法生成它们。主要存储中创建并添加到代码回购

https://github.com/bhanu888/buildapk

gradle flutter keystore android-keystore
1个回答
6
投票

对我来说这是一个寻路问题。

我是继扑引导https://flutter.io/docs/deployment/android

Create a file named <app dir>/android/key.properties that contains a reference to your keystore:

出于某种原因,我(错误地)把我的“key.properties”在APP_DIR /安卓/ app文件夹,这给我的错误。

* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path='null'

因此,检查你的寻路,并在您的文件位于:)

奖励方式:什么帮助MED是检查使用不同的设置了“gradle.build”文件,它总是在storeFile文件(keystoreProperties [“storeFile”]),这给了我的问题。尝试注释掉它,或将其更改为:

storeFile file("key.jks")  

如果一切正常,你知道你有正确的路径到你的“key.jks”文件。然后尝试引入poperties文件(keystoreProperties)赞

storeFile file(keystoreProperties['storeFile']) 

这起初并不工作,但它现在:)

所以,再一次检查你“key.jks”和“key.properties”文件位于“正确”的地方,以及你如何指向它们。


2
投票

如果从github上下载的应用程序,它有可能签约CONFIGS是音符调整。尝试像这样在Android /应用/的build.gradle评论代码:

    /*signingConfigs {
    release {
  keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties['keyPassword']
        storeFile file(keystoreProperties['storeFile'])
        storePassword keystoreProperties['storePassword']
    }
}
buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.release
    }
   */`

解决方法找到:https://github.com/transistorsoft/flutter_background_geolocation/issues/18


0
投票

如果你只是测试或调试,不释放,你可能会考虑修改构建类型进行调试,而不是释放。

In <APP_FOLDER>/android/app/build.gradle

buildTypes {
        release {
            signingConfig signingConfigs.debug
       }
    }
© www.soinside.com 2019 - 2024. All rights reserved.