Questions tagged «android-studio-2.2»

7
不支持的方法:运行项目时,AndroidProject.getPluginGeneration()
我正在尝试使用Android Studio 2.2运行我的项目,但出现此错误 Unsupported method: AndroidProject.getPluginGeneration(). The version of Gradle you connect to does not support that method. 我正在使用ButterKnife 8.4.0 我的应用程式gradle.file: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } 我的模块gradle文件: apply plugin: 'com.android.application' apply plugin: 'android-apt' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { …

7
警告:请勿将Android上下文类放在静态字段中;这是内存泄漏(并且还会中断即时运行)
Android Studio: 不要将Android上下文类放在静态字段中;这是内存泄漏(并且还会中断即时运行) 所以有两个问题: #1您如何startService从没有静态变量的静态方法中调用a ? #2您如何通过静态方法(相同)发送localBroadcast? 例子: public static void log(int iLogLevel, String sRequest, String sData) { if(iLogLevel > 0) { Intent intent = new Intent(mContext, LogService.class); intent.putExtra("UPDATE_MAIN_ACTIVITY_VIEW", "UPDATE_MAIN_ACTIVITY_VIEW"); mContext.startService(intent); } } 要么 Intent intent = new Intent(MAIN_ACTIVITY_RECEIVER_INTENT); intent.putExtra(MAIN_ACTIVITY_REQUEST_FOR_UPDATE, sRequest)); intent.putExtra(MAIN_ACTIVITY_DATA_FOR_VIEW, sData); intent.putExtra(MAIN_ACTIVITY_LOG_LEVEL, iLogLevel); LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); 不使用此方法的正确方法是什么mContext? 注意:我认为我的主要问题可能是如何将上下文传递给调用方法所在的类。

4
Android Studio错误:错误:CreateProcess错误= 216,此版本的%1与您正在运行的Windows版本不兼容
安装了Android Studio 2.2 Preview 2并收到此错误: 错误:CreateProcess错误= 216,此版本的%1与您正在运行的Windows版本不兼容。检查计算机的系统信息,然后与软件发行商联系 屏幕截图: 我重新安装了JDK,仍然是同样的问题。 我什至尝试使用嵌入式JDK,但仍然存在相同的问题:
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.