@UPDATE
非常感谢你。现在至少没有错误。但它仍然与之前的工作方式相去甚远 - 它应该如何运作。现在,数据库看起来......很奇怪。我认为这个问题仍然存在问题。
它应该不像。根据数据库中的java代码将是用户及其数据(姓名,电子邮件,帐户创建日期,ID头像)
在头像旁边的网站上的应用程序中,您应该显示名称。不幸的是,你可以看到没有任何反应。代码没有任何问题,因为它之前有效。 :(
我毁了我的项目!我试图解决它,但现在它比它更糟。
该项目是通过Firebase的聊天客户端。
当我删除我的基地时就开始了。我有太多的测试用户,我希望清除它的消息。从那时起,它会收到一百万条错误通知 - 尝试修复一件事会导致更糟糕的错误。
我尝试连接到完全不同的应用程序基础,我试图重新安排一些事情。什么都没有帮助。起初我认为问题在于编译错误'com.google.firebase:firebase-database:9.8.0'号。然后我收到了
E / FirebaseApp:Firebase API初始化失败。
我试着解决它。应用程序启动并在数据库中是非常奇怪的事情。
现在我
错误:任务':app:packageDebug'的执行失败。> !zip.isFile()
build.gradle(项目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
build.gradle(module:app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.rachel.komunikator"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
testCompile 'junit:junit:4.12'
}
Google Play服务 在我的模拟器上
我正在使用:Android Studio 2.2.3和Nexus 5X Emulator
@UPDATE
W / DynamiteModule:找不到com.google.firebase.auth的本地模块描述符类。 E / FirebaseApp:Firebase API
初始化失败。 d / FirebaseApp:
com.google.firebase.crash.FirebaseCrash未链接。跳过初始化。
所有日志:
W/System: ClassLoader referenced unknown path: /data/app/com.example.rachel.komunikator-2/lib/x86
[ 02-02 20:56:04.988 1566: 1589 D/ ]
HostConnection::get() New Host Connection established 0x8cf20100, tid 1589
I/InstantRun: Instant Run Runtime started. Android package is com.example.rachel.komunikator, real application class is null.
W/System: ClassLoader referenced unknown path: /data/app/com.example.rachel.komunikator-2/lib/x86
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
E/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.firebase.iid.zzg' (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/com.example.rachel.komunikator/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_8eee9db5e99a0da2dcdc7b52647c81db3aed29e6-classes.dex)
at com.google.firebase.iid.zzg.zzeC(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzg.<init>(Unknown Source)
at com.google.firebase.iid.zzd.zzb(Unknown Source)
at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
E/FirebaseApp: Firebase API initialization failure.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NoSuchMethodError: No static method zzz(Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/data/com.example.rachel.komunikator/files/instant-run/dex/slice-com.google.android.gms-play-services-basement-9.8.0_b60271da061b8a83af31355011409573bfa72cef-classes.dex)
at com.google.android.gms.measurement.internal.zzx.zzbd(Unknown Source)
at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at com.google.firebase.FirebaseApp.zza(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
答案 0 :(得分:62)
清洁和重建项目应该有效。它对我有用。看看这个:https://code.google.com/p/android/issues/detail?id=230211
答案 1 :(得分:8)
关于这个:
错误:任务':app:packageDebug'的执行失败。&gt; !zip.isFile()
我通过删除build
项目并再次运行来解决它。
希望这有帮助。
答案 2 :(得分:6)
运行./gradlew clean非常简单
如果您使用的是Cordova或Ionic Framework,请运行以下命令
List<int> integers = new List<int> { 1, 2, 3 };
DataTable dataTable = new DataTable();
dataTable.Columns.Add("n", typeof(int));
dataTable.SetTypeName("integer_list_tbltype");
foreach (int i in integers)
dataTable.Rows.Add(i);
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO YourTable (n) SELECT n FROM @integers";
cmd.Parameters.Add("@integers", SqlDbType.Structured);
cmd.Parameters["@integers"].Direction = ParameterDirection.Input;
cmd.Parameters["@integers"].TypeName = "integer_list_tbltype";
cmd.Parameters["@integers"].Value = dataTable;
cmd.ExecuteNonQuery();
}
易于修复。
答案 3 :(得分:3)
我在几分钟前就遇到了这个问题,我在这个问题上尝试了一些方法,但这不起作用。所以我向其他程序员寻求帮助,然后就可以了!
这很容易!就这样做,如下图所示。
我希望这会对你有所帮助。
答案 4 :(得分:3)
只需禁用即时运行:
Android Studio -> Preferences -> Instant Run
答案 5 :(得分:1)
将此行移至module:app
build.gradle:
apply plugin: 'com.google.gms.google-services'
中的示例
答案 6 :(得分:0)
您缺少核心火力库lib。
添加compile 'com.google.firebase:firebase-core:9.8.0'
答案 7 :(得分:0)
此问题已修复 AG / I6a6ef1a95732118b8e330b64fe4389710a3a2657。请使用更新的gradle 插件2.3.0-beta2或者,如果使用2.2.x,则使用禁用新包装 “android.useOldPackaging = true”标志。
答案 8 :(得分:0)
我解决了这个问题。我只是将我的gradle版本从2.2.3更改为2.2.2
classpath 'com.android.tools.build:gradle:2.2.2'
答案 9 :(得分:0)
就我而言,我点击了重建图标(其指南:&#34;使用gradle文件同步项目&#34;)并解决了问题
答案 10 :(得分:0)
我使用Cordova CLI并且不时遇到这个问题。鉴于我在Windows 10计算机上本地构建用户权限不是问题。我发现Cordova有时会删除android / builds文件夹,但由于某种原因无法创建它。我只是手动重新创建该文件夹,而且所有文件夹都是hunkry-dory。
答案 11 :(得分:-1)
右键点击项目的根ex:app select&gt;&gt;在资源管理器中显示并删除.gradle文件,然后点击干净的OR Built选项,它将100%工作。