当我尝试build > generate signed bundle
AS 抱怨时:
生成签名包需要您将 Android Gradle 插件更新到版本 3.2.0 或更高版本
如果我单击Close this dialog and update the plugin
另一个对话框(AS Bumblebee),标题为“update the Android Gradle plugin如果我点击确定”,该对话框就会消失,什么也不会发生,当我尝试再次构建签名的应用程序包时,我会收到相同的抱怨。
这真的很令人沮丧,因为我无法在没有签名的情况下使用 Googlemaps 上传应用程序。这就是我的整个应用程序!
好吧,类似的问题已经在 StackOverflow 上得到了多次解答,但有些解决方案已经过时,其他解决方案似乎不相关:
File > project structure。android/build.gradle,那么它已经有 gradle 7.03,远高于 3.2.0。虽然Gradle和Android Studio的Gradle插件可能有不同的版本号。请参阅下面的代码片段。Preferences > SDK tools,但没有提到 gradle 插件。这是我的文件的相关部分android/build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath …Run Code Online (Sandbox Code Playgroud) build.gradle android-gradle-plugin flutter android-app-bundle
好吧,Windows 10更新打破了睡眠,计算机在模拟器打开的情况下进入睡眠状态,现在已经坏了.当我运行应用程序以在模拟器中启动时,它将启动模拟器,但不会安装超时.当我尝试将应用程序运行到正在运行的模拟器实例时,Studio说:
com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK
Run Code Online (Sandbox Code Playgroud)
真是一场噩梦.
如何设置供应商密钥?使用AS控制台命令?任何人都可以指向我一个虚拟指南,这对我来说有点切,希望我能从GUI修复它.
我试图让一个应用程序在我的 Android Studio 模拟器上运行,当我点击运行时,它抱怨:未知的命令行选项“--version”
我尝试过一些事情
--version我已经下载了工具 SDK。
运行过程如何进行?它首先读取项目中的哪些文件来安排其流程?我的模拟器是Android API 30,我的项目的targetSdkVersion是32。
某些 AS IDE 挂钩/命令在命令行中不可用是否存在故障?这似乎是它所说的。我也无法从 AS 的终端运行 Flutter 命令。
如果这是问题我该如何解决?
如果没有这个工作,我将无法在模拟器上运行任何应用程序。
android-emulator android-studio flutter android-studio-bumblebee
我正在尝试使用 Flutter 的url_launcher插件来打开网页。
当我单击按钮 url_launcher 时,成功打开网页。但是,如果我随后通过向左滑动或使用软后退按钮导航回来,应用程序就会崩溃。日志说
java.lang.RuntimeException:无法销毁活动{uk.co.pottertour.map_edinburgh_guide_airbnb/io.flutter.plugins.urllauncher.WebViewActivity}:java.lang.IllegalArgumentException:接收器未注册:io.flutter.plugins.urllauncher.WebViewActivity$1 @8152196
它说 WebViewActivity 所以大概 Url_Launcher 没有打开外部浏览器,而是打开应用程序内的 Webview。
这非常关键,这个应用程序基本上是令人兴奋的事情的中心。
我怀疑是我的didChangeAppLifecycleState函数导致了错误,因为它是在恢复时发生的,但不是,这是在 Flutter 运行构建并重建屏幕时发生的。
我尝试注释掉我的构建过程中包含 url_launcher 链接的部分,相信重建触发了它,但这没有帮助。也许有一些后台异步进程会在应用程序绘制到屏幕之前引发此错误。与 url_launcher 相关。
我正在使用GeoFlutterFire,这是 Flutter 的一个插件,它筛选指定 GeoFirePoint 附近记录的集合。
距离键应该与 Firestore 一起返回,<DocumentSnapshot>s但没有返回,只有默认键。当我如下寻找它时,它返回空值。钥匙不存在。
geopoint而是它在 Firestore 上设置的虚拟值。这是非常令人沮丧的,我需要距离以便我可以在应用程序的卡片上显示它,我的代码非常接近插件的示例代码,所以我不明白为什么它不起作用。
GeoFirePoint usersAddressGeoFirePoint =
geo.point(latitude: 56.088944, longitude: -4.151800);
localJobsStream = geo.collection(collectionRef: myFirestore.collection('JobsMeta'))
.within(center: usersAddressGeoFirePoint, radius: 1000, field: 'position', strictMode: true);
localJobsStream.listen((List<DocumentSnapshot> documentList) {
${documentList[0].data.keys.contains('distance')}");
}
Run Code Online (Sandbox Code Playgroud) 完整的错误是这个
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat= https://www.youtube.com/watch?v=xKJmEC5ieOk }
Run Code Online (Sandbox Code Playgroud)
不知道发生了什么。我查看了其他 S/O 帖子,网址看起来格式正确,http:// 是小写,并且存在。
但是,如果我将它作为字符串文字插入,它会在浏览器中正确启动而不是 url String 变量。疯狂的。我在日志中打印了 url,没有奇怪的标点符号把它弄乱。无法理解。
这是它抛出异常的地方:
@Override
public void onClick(String url) {
Log.v(TAG, "launching intent: " + url);
Intent mIntent = new Intent(Intent.ACTION_VIEW);
mIntent.setData(Uri.parse(url));
startActivity(mIntent);
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?喜欢一些帮助。
我在将升级后的项目上传到 Google Play 时遇到困难。
我需要生成应用程序的签名版本,但如果我尝试应用程序捆绑包,它会抱怨我有一个过时的 Gradle 插件,无法升级。我的 gradle-wrapper.properties 中有一个前沿的 gradle 版本:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
因此,我尝试创建一个签名的 apk 并给它一个密钥库,但是当它尝试输出该应用程序时,它会抛出此投诉:
无法确定 Android API 30 平台的“tools.jar”库的路径(C:/Users/Sam/AppData/Local/Android/Sdk)
advanced system variables,但这不起作用。tools.jar到 C:/Users/Sam/AppData/Local/Android/Sdk,但这不起作用。我咬牙切齿。
我正在尝试以编程方式布局自定义infoWindow.我想使用Picasso加载一个streetView预览图像,但图像没有显示出来,任何想法为什么?
private View prepareInfoView(Marker marker){
//prepare InfoView programmatically
LinearLayout infoView = new LinearLayout(EarthquakeActivity.this);
LinearLayout.LayoutParams infoViewParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
infoView.setOrientation(LinearLayout.VERTICAL);
// attach the above layout to the infoView
infoView.setLayoutParams(infoViewParams);
//create street view preview @ top
ImageView streetViewPreviewIV = new ImageView(EarthquakeActivity.this);
// this scales the image to match parents WIDTH?, but retain image's height??
LinearLayout.LayoutParams streetViewImageViewParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
streetViewPreviewIV.setLayoutParams(streetViewImageViewParams);
String imageURL = "https://maps.googleapis.com/maps/api/streetview?size=200x200&location=";
String markerLongitude = Double.toString(marker.getPosition().longitude);
String markerLatitude = Double.toString(marker.getPosition().latitude);
imageURL += markerLatitude + "," + …Run Code Online (Sandbox Code Playgroud) 我一直在疑惑这个问题。我希望具有不同文本的 2 个按钮具有相同的宽度。
我通过使 ElevatedButton 成为 SizedBox 的子项来实现这一点,但我担心如果用户将默认字体大小设置为大,则 Button 标题文本将被剪裁。
我可以在 ElevatedButton 的样式属性上放置一个“minimumSize”:
style: ButtonStyle(minimumSize: ),
但我不知道如何设置 minimumSize,它想要这个:
{MaterialStateProperty minimumSize} 类型:MaterialStateProperty 按钮本身的最小尺寸。每个tapTargetSize 按钮所在的矩形的大小可能更大
我不知道如何设置 MaterialStateProperty,Android Studio 抱怨“无法实例化抽象类”。帮助!
这很奇怪,包含 FilterChips 的 Wrap 小部件在其父级 ExpansionPanel 内居中。我试过将 Wrap Widget 包装在一个灵活的小部件中,没有反应,我试过包装在一个 Expanded 小部件中,没有反应。
“扩展”面板上似乎没有用于左对齐主体的属性:小部件。这很重要,因为当 Wrap 小部件被强制为全宽时,一些 ExpansionPanel 向左对齐,但其他人,如图所示,居中。最终,我将把 ExpansionPanel 中的所有子小部件包装在一个 Padding 小部件中,但我需要先将子 Wrap 小部件左对齐。
bool travelSack;
ExpansionPanelRadio backpackingPanel = ExpansionPanelRadio(
value: "Backpacking",
headerBuilder: (BuildContext context, bool isExpanded) {
return ListTile(
leading: FaIcon(
FontAwesomeIcons.globeEurope,
size: 19,
),
title: Text("Backpacking"),
);
},
body: Expanded(child:
Wrap(spacing: 4, children: [
FilterChip(
showCheckmark: false,
label: Text('Travel rucksack'),
labelStyle: TextStyle(
color: travelSack ? Colors.black : Colors.white,
),
selected: travelSack,
onSelected: (bool selected) {
setState(() {
travelSack = …Run Code Online (Sandbox Code Playgroud) 我已经做出了最善良的kris larson建议的更改,而我现在还没有从onCreateLoader返回正确的类型
return new StoriesLoader(getContext(), uriBuilder.toString());
Run Code Online (Sandbox Code Playgroud)
StoriesLoader:
import android.content.AsyncTaskLoader;
import android.content.Context;
import java.util.List;
/**
* Loads a list of news stories by using an AsyncTask to perform the
* network request to the given URL.
*/
public class StoriesLoader extends AsyncTaskLoader<List<NewsStory>> {
/** Tag for log messages */
private static final String LOG_TAG = StoriesLoader.class.getName();
/** Query URL */
private String mUrl;
/**
* Constructs a new {@link StoriesLoader}.
*
* @param context of the activity
* @param url to …Run Code Online (Sandbox Code Playgroud) 我有一个想法,他们都得到'上下文',以便功能知道它们如何适应事物的方案,这是对的吗?
进化猿的任何线索?
flutter ×7
android ×4
widget ×2
alignment ×1
build.gradle ×1
geofire ×1
google-maps ×1
infowindow ×1
picasso ×1
plugins ×1
sdk ×1
themes ×1
tools.jar ×1
url-launcher ×1