Questions tagged «android»

Android是Google的移动操作系统,用于对数字设备(智能手机,平板电脑,汽车,电视,Wear,Glass和IoT)进行编程或开发。对于与Android相关的主题,请使用特定于Android的标签,例如android-intent,android-activity,android-adapter等。对于与开发或编程无关但与Android框架相关的问题,请使用以下链接:https:// android.stackexchange.com。

12
找不到com.google.android.gms:play-services:3.1.59 3.2.25 4.0.30 4.1.32 4.2.40 4.2.42 4.3.23 4.4.52 5.0.77 5.0.89 5.2.08 6.1。 11 6.1.71 6.5.87
通过gradle引用播放服务对我来说不再起作用-煮熟了-甚至我最初用作参考的示例也停止了工作:https: //plus.google.com/+AndroidDevelopers/posts/4Yhpn6p9icf FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':auth'. > Failed to notify project evaluation listener. > Could not resolve all dependencies for configuration ':auth:compile'. > Could not find com.google.android.gms:play-services:3.1.36. Required by: gpsdemos:auth:unspecified * Try: Run with --stacktrace option to get …

6
Android Studio 3.0风味尺寸问题
升级到Studio Canary版本。我之前的Telegram Messenger项目中出现以下错误。 错误:所有风味现在必须属于命名的风味维度。没有将风味“ armv7”分配给风味尺寸。进一步了解https://d.android.com/r/tools/flavorDimensions-missing-error-message.html 我该怎么办?我已经看过该链接,但不知道该怎么办。我现在有3个构建变体,即release,debug和foss。


30
APK文件在磁盘上不存在
当我尝试在Android Studio上调试应用程序时,给出以下日志输出: APK文件/Users/MyApplicationName/app/build/outputs/apk/app-debug.apk在磁盘上不存在。 我重新启动了Android Studio,但无法解决此问题。我该如何解决?谢谢


10
Android清单中的versionCode与versionName
我在android市场上有我的应用程序,版本代码= 2,版本名称= 1.1 但是,在今天进行更新时,我在清单中更改了版本代码= 3,但是错误地将我的版本名称更改为1.0.1并将apk上传到了市场。 现在,我的应用程序的用户是否会在手机上收到更新通知?还是应该重做一次?

30
Android Material和Appcompat Manifest合并失败
我下一年级 dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-rc01' implementation 'com.android.support.constraint:constraint-layout:1.1.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.google.android.material:material:1.0.0-rc01' } 但是当我要构建应用程序时,我会收到下一条日志: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0-alpha3] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0-alpha3] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override. 哎呀!进行清单并执行以下操作: …

8
不推荐使用FirebaseInstanceIdService
希望大家都知道这个类,用于在刷新Firebase通知令牌时获取通知令牌,我们从此类中从以下方法获取刷新的令牌。 @Override public void onTokenRefresh() { // Get updated InstanceID token. String refreshedToken = FirebaseInstanceId.getInstance().getToken(); Log.d(TAG, "Refreshed token: " + refreshedToken); } 为了在我要实现FCM时使用它,我从扩展了MyClass。 FirebaseInstanceIdService 但是,表明FirebaseInstanceIdService已过时 有人知道吗?,不推荐使用什么方法或类代替刷新令牌。 我正在使用 : implementation 'com.google.firebase:firebase-messaging:17.1.0' 我检查了文档是否相同,对此没有提及。:FCM设置文件 更新 这个问题已被解决。 随着Google弃用FirebaseInstanceService, 我问了这个问题以找到方法,我知道我们可以从FirebaseMessagingService获取令牌, 和以前一样,当我问问题文档未更新但现在Google文档已更新以便获取更多信息时,请参阅此google文档:FirebaseMessagingService OLD从:FirebaseInstanceService(已弃用) @Override public void onTokenRefresh() { // Get updated InstanceID token. String refreshedToken = …

6
如何从处理程序中删除所有回调?
我有一个来自主Activity调用的子Activity中的Handler。该处理程序由某些Runnable 的子类使用,但我无法对其进行管理。现在,在这种情况下,我需要先删除它们,然后再完成“活动”(以某种方式调用,但仍会反复调用)。无论如何,要从处理程序中删除所有回调吗?postDelayonStopfinish()


9
XML中的“图像上缺少contentDescription属性”
我在Eclipse中收到有关[Accessibility] Missing contentDescription属性的警告。此警告显示在ImageView下面的XML代码的第5行(声明)。 在构建和运行我的应用程序时,这不会出错。但是我真的很想知道为什么我会收到这个警告。 这是我的XML文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/contact_entry_image" android:src="@drawable/ic_launcher" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/contact_entry_text" android:text="" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="30sp" /> </LinearLayout> 请对此提供帮助,并感谢您的阅读。

22
如何在Android RecyclerView中添加分隔线?
我正在开发一个正在使用的android应用程序RecyclerView。我需要添加一个分压器在RecyclerView。我试图添加- recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST)); 以下是我的xml代码- <android.support.v7.widget.RecyclerView android:id="@+id/drawerList" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" />

23
Android致命信号11(SIGSEGV)位于0x636f7d89(代码= 1)。如何找到它?
我一直在阅读其他文章,以追踪SIGSEGV在Android应用程序中获取的原因。我计划在我的应用程序中搜索与Canvas使用相关的可能的NullPointers,但我SIGSEGV每次都会使用不同的内存地址。另外我看过code=1和code=2。如果内存地址是0x00000000,那么我就知道它是NullPointer。 我得到的最后一个是code=2: A/libc(4969): Fatal signal 11 (SIGSEGV) at 0x42a637d9 (code=2) 关于如何追踪这个的任何建议? 我有一个嫌疑犯,但是我还不愿意尝试它。我的应用程序使用OSMDroid API进行离线映射。OverlayItem类表示地图上的标记/节点。我有一个服务,可通过网络收集数据以填充OverlayItem,然后将其显示在地图上。为了简化设计,我将OverlayItem扩展到我自己的NodeOverlayItem类中,该类包括我在UI Activity和Service中使用的一些附加属性。这给了我关于UI和服务的单点信息。当发生更改时,我使用Intents广播到Activity来刷新UI映射。活动绑定到服务,并且有一个Service方法来获取NodeOverlayItem的列表。我认为这可能是OSMDroid API对OverlayItem的使用,和我的服务同时更新节点信息。(并发问题) 在我撰写本文时,我认为这确实是问题所在。令人头疼的不是将Node和OverlayItem从NodeOverlayItem中分离出来,而是因为Activity需要来自Node的一些数据,而该数据是服务所拥有的。另外,当创建活动(onResume等)时,需要根据活动不在时服务一直在维护的Node数据重新创建OverlayItem对象。例如,您启动应用程序,服务会收集数据,UI会显示它,您转到首页,然后回到应用程序,活动将需要从最新的服务节点数据中提取并重新创建OverlayItem。 我知道这不是一个很好的或明确的问题。就像我所有的SO问题都是利基或晦涩的。如果有人对如何解释这些SIGSEGV错误有任何建议,将不胜感激! 更新 这是在调试会话期间捕获的最新崩溃。我有3个这样的设备用于测试,在我进行开发和测试时,它们并不会全部崩溃。我添加了一些额外内容,以便可以记录GC日志记录。您可以看到该问题可能与内存耗尽无关。 03-03 02:02:38.328: I/CommService(7477): Received packet from: 192.168.1.102 03-03 02:02:38.328: I/CommService(7477): Already processed this packet. It's a re-broadcast from another node, or from myself. It's not a repeat broadcast though. 03-03 02:02:38.406: …

8
ADB Shell输入事件
adb shell input keyevent和之间的基本区别是adb shell sendevent什么?输入字符应该使用哪一个?我们传递给两个命令的键码是否相同?
221 android  adb 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.