I'm new in android studio, when I want export the apk it give me error. This:
Error:A problem was found with the configuration of task ':app:packageRelease'.
File 'sistemasmas' specified for property 'signingConfig.storeFile' does not exist.
How do I fix this error?
This is my build.gradle:
int main()
{
int k;
std::cout<<"Rings count?"<<std::endl;
std::cin>>k;
dlring<int>* dlist = new dlring<int>[k]; //I suppose I'm allocating *k*
//dlring<int> elements. this line is not confirmed to call the constructor.
(dlist[0]).Push(10);
(dlist[0]).Push(13);
(dlist[1]).Push(99);
/*{
while(!dlist[0].empty())
std::cout<<(dlist[0]).pop_back()<<" ";
std::cout<<std::endl;
while(!dlist[1].empty())
std::cout<<(dlist[1]).pop_back()<<" ";
}*/
//this section works perfectly fine, while this
for(int i=0;i<k;i++)
{
while(!dlist[k].empty())
std::cout<<(dlist[k]).pop_back()<<" ";
std::cout<<std::endl;
}
//is causing a segmentation fault while attempting to access dlist[*0*].tail->data.
std::cout<<(dlist[0]).head->data;
//line was checked and is confirmed to be functional,
//I suppose dlist[variable] has some trick I don't know yet.
//what I wish to look like an instance call would be *
return 0;
}
答案 0 :(得分:2)
将签名配置添加到app
模块的构建文件
android {
...
defaultConfig { ... }
signingConfigs {
release {
storeFile file("myreleasekey.keystore")
storePassword "password"
keyAlias "MyReleaseKey"
keyPassword "password"
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
它将解决您的问题。它帮助了我。
答案 1 :(得分:0)
您可以使用&#39;生成签名Apk&#39;工具。 查看Android Studio的Build - &gt;生成已签名的APK菜单。
否则,如果您希望使用命令打包项目。您需要在发布部分中定义这些。
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
android.signingConfigs.release.storeFile = file('C://your-release-key.keystore')
android.signingConfigs.release.storePassword = "yourstorePassword"
android.signingConfigs.release.keyAlias = "yourkeyAlias"
android.signingConfigs.release.keyPassword = "yourkeyPassword"
}
但是,将你的传递直接放在build.gradle中是不安全的。
答案 2 :(得分:0)
在版本{部分中,它对我不起作用,但以下内容
android {
signingConfigs {
Signature {
keyAlias 'yourfilealias'
keyPassword 'yourkeypassword'
storeFile file('keystore.jks')
storePassword 'yourstorepassword.'
}
} ...
注意:keystore.jks可能需要你之前的路径。