我只是试图用Flutter运行我的第一个hello world应用程序。但是在选择模拟器并运行时单击它会显示错误。
这是我的代码:
import "package:flutter/material.dart";
void main()
{
runApp(
Center(child:Text("Hello world!", textDirection: TextDirection.ltr) ,)
);
}
和我得到的错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> org/apache/commons/codec/binary/Base64
* 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 13s
Finished with error: Gradle task assembleDebug failed with exit code 1
怎么了?我该如何解决?
答案 0 :(得分:0)
根据此github issue,您只需将其添加到build.gradle
文件中即可:
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
答案 1 :(得分:0)