Android多项目错误:java.lang.IllegalStateException:无法执行android:onClick的方法 [英] Android Multi Project Error: java.lang.IllegalStateException: Could not execute method for android:onClick
问题描述
为什么要投票?我的问题很清楚...
Why downvotes? My Question is clear...
我有一个带有此结构的项目
i have a Project with this Strukture
- 应用
- AppModule(计算器)
- 第2单元(天气)
- 第3单元(地图)
- App
- AppModule (Calculator)
- Module 2 (Weather)
- Module 3 (Map)
因此,Module2是Weather-Aplication,Module3是Map-Application. 我的项目在Module3之外运行得很好.但是当我导入Module3时,通过单击(激活)modul2导致应用程序崩溃,并显示以下错误:
So, the Module2 is a Weather-Aplication, the Module3 is a Map-Application. my Project runs witout Module3 very well. But when i import Module3, the App crashed by clicking (activate) modul2 with the following error:
07-21 12:41:30.533 8656-8656/bakteriusdeveloper.master I/art: Rejecting re-init on previously-failed class java.lang.Class<com.cs.android.weminder.MainActivity> 07-21 12:41:30.534 8656-8656/bakteriusdeveloper.master D/AndroidRuntime: Shutting down VM 07-21 12:41:30.538 8656-8656/bakteriusdeveloper.master E/AndroidRuntime: FATAL EXCEPTION: main Process: bakteriusdeveloper.master, PID: 8656 java.lang.IllegalStateException: Could not execute method for android:onClick
在 Modul2-天气中,我需要使用
compile 'com.google.android.gms:play-services:6.1.71'
在 Module3-地图中,我需要使用
compile 'com.google.android.gms:play-services:9.2.1'
我的问题是:
- 不同的依赖关系是否会导致我的问题?
- 如果是,我该如何处理?
- 我应该管理不同的依赖项吗?
这是我的App build.gradle:
This is my App build.gradle:
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "bakteriusdeveloper.master" minSdkVersion 19 targetSdkVersion 21 // Enabling multidex support. multiDexEnabled true versionCode 3 versionName "1.2" }
推荐答案
首先,为什么要使用这样的旧Play服务构建模块2?像这样不是傻香肠的艺术代表.
first of all why you have build your module 2 with such old Play Services? like this is not stand of the art u silly sausage.
第二: 问题: 尝试在您的主要方法中使用以下代码:
Second: different dependencies are ur Problem: try using this code in ur main method:
defaultConfig { minSdkVersion 14java.lang.IllegalStateException: truemultiDexEnabled *#*#3264#*#*} stmt.close(); con.close(); } catch (Exception f){} if(loginNameAusDB.equals(loginname)&&loginPWAusDB.equals(loginpassname)){ jp_center.removeAll(); } }
我很高兴能尽我所能帮助您
im pleased to help u with all my knowledge
这篇关于Android多项目错误:java.lang.IllegalStateException:无法执行android:onClick的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!