草庐IT

android - 错误 : IllegalArgumentException: The style on this component requires your app theme to be Theme. Material 组件

下面是我的依赖implementation'com.google.android.material:material:1.0.0'implementation'androidx.appcompat:appcompat:1.0.2'implementation'androidx.constraintlayout:constraintlayout:1.1.3'我的layout.xml上面的代码对我来说工作正常但是当我更新materialdesign的dependenciesimplementation'com.google.android.material:material:1.1.0-a

android - Android 版 Facebook SDK 中的 "Facebook cannot be resolved to a type"

我按照将FacebookAndroidSDK添加到Eclipse的说明进行操作,但由于某种原因,当我重新启动Eclipse时,对于从Facebooklib导入的所有类型,我一遍又一遍地收到此错误。"Xcannotberesolvedtoatype" 最佳答案 如果你已经完成了这一步:您按Ctrl-Shift-O修复所有导入。 关于android-Android版FacebookSDK中的"Facebookcannotberesolvedtoatype",我们在StackOverflow上

java - "ic_launcher cannot be resolved or is not a field"

我正在学习Android的教程并且完成所有操作后,我在这段代码中遇到了问题:getDrawable(R.drawable.ic_launcher);我收到消息了**"ic_launchercannotberesolvedorisnotafield"**此外,我的图标没有出现在平板电脑模拟器中,但自动启动。怎么回事? 最佳答案 将“mipmap”替换为“drawable”我在学习教程时遇到了同样的问题,我发现我的AndroidManifest.xml文件具有以下代码:-android:icon="@mipmap/ic_launcher

Kafka【问题 03】Connection to node -1 (/IP:9092) could not be established. Broker may not be available.

1.报错详情此问题仅出现在云服务器上,非云服务器未出现过一下报错:15:50:26.736[kafka-producer-network-thread|producer-1]WARNo.a.k.c.NetworkClient-[processDisconnection,782]-[ProducerclientId=producer-1]Connectiontonode-1(/172.81.205.216:9092)couldnotbeestablished.Brokermaynotbeavailable.2.配置问题非云服务器:#报错时仅配置了listeners=PLAINTEXT://IP:

java - Android Studio错误: "Method getText() must be called from the UI Thread,当前推断线程是worker

我正在androidstudio中创建一个CRUD操作,但我不断收到错误。错误是当我检查LogCat这是他们给我看的内容line156-1581907-1931/com.example.casquejo.loginadminE/AndroidRuntime﹕FATALEXCEPTION:AsyncTask#2Process:com.example.casquejo.loginadmin,PID:1907java.lang.RuntimeException:AnerroroccuredwhileexecutingdoInBackground()Causedby:java.lang.Nul

android - 错误 : incompatible types: GsonConverterFactory cannot be converted to Factory

这个问题在这里已经有了答案:retrofitconvertorfactorycannotaccessGsonConverterFactory(5个答案)关闭7年前。我在设置转换器时尝试使用Retrofit2.0.0.beta2像下面的GsonRetrofitretrofit=newRetrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build();在这个gradle抛出错误之后GsonConverterFactorycannotbeconvertedtoFacto

android - 打开 pdf 文件错误 : This file could not be accessed Check the location or the network and try again. Android 6 Marshmallow

我正在尝试从外部存储中获取文件,然后我必须使用intents将该文件发送给pdf阅读器。之前下面的代码运行良好,但在安装Android6(Marshmallow更新)后,我的代码无法运行并收到toast消息“无法访问此文件请检查位置或网络并重试。”(这是由于新的android运行时权限)。我刚刚尝试了所有的解决方案(内容提供商等但没有工作)任何解决方案?Filefile=newFile(getFilesDir(),"myfile.pdf");Intentintent=newIntent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.from

android - 类转换异常 : AbsListView$LayoutParams cannot be cast to Gallery$LayoutParams

我正在尝试开发Android3.1平板电脑应用程序。这个app会有很多图片,我已经关注了ProcessingBitmapsOfftheUIThread教程,但我做错了,因为我得到:java.lang.ClassCastException:android.widget.AbsListView$LayoutParams无法转换为android.widget.Gallery$LayoutParams这是我的代码:我在Activity上设置图库mFactGallery=(Gallery)mView.findViewById(R.id.factGallery);mFactGallery.setA

java - Dagger2 "cannot be provided without an @Provides-annotated method."问题

我正在尝试使用Dagger2设置一个新项目,我以前使用过Dagger2,但现在我正在尝试自己从头开始设置它。我正在从我参与的Kotlin项目中获取示例,但无法像现在在Kotlin中一样为Java设置它(或者我可能遗漏了一些东西)。它只是一个组件、一个模块和一个应用程序。组件@Singleton@Component(modules={MainAppModule.class})publicinterfaceAppComponentextendsAndroidInjector{@Component.BuilderabstractclassBuilderimplementsAndroidInj

android - ' :app' cannot be executed in the current context - android studio 3. 2.1

我在我的项目中使用OneSignal,如下所示:deftaskRequests=getGradle().getStartParameter().getTaskRequests().toString()defisPlay=!(taskRequests.contains("Foss")||taskRequests.contains("foss"))buildscript{repositories{maven{url'https://plugins.gradle.org/m2/'}}dependencies{classpath'gradle.plugin.com.onesignal:ones