我在 Flutter 项目中遇到 Gradle 错误,但似乎无法解决。当我尝试构建并运行 Flutter 应用程序时,出现以下错误:
Could not apply requested plugin [id: 'dev.flutter.flutter-gradle-plugin', version: '1.0.0'] as
it does not provide a plugin with id 'dev.flutter.flutter-gradle-plugin'. This is caused by an
incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id 'dev.flutter.flutter-gradle-plugin' not found.
Run Code Online (Sandbox Code Playgroud)
此错误是在我的应用程序模块的 build.gradle 文件中的这一行触发的:
apply plugin: 'dev.flutter.flutter-gradle-plugin'
Run Code Online (Sandbox Code Playgroud)
如果您需要任何进一步的信息来帮助我解决此问题,请告诉我。谢谢你!
根据我的老师的答案,malloc动态分配内存,然后为什么输出显示为正常变量和分配相同的大小malloc();。我是编程的新手,所以我想您会以新手可以理解的方式回答我的问题。
#include<stdio.h>
int main()
{
int a,b;
a = (int *) malloc(sizeof(int)*2);
printf("The size of a is:%d \n",sizeof(a));
printf("The size of b is:%d \n",sizeof(b));
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出:
The size of a is:4
The size of b is:4
Run Code Online (Sandbox Code Playgroud)