- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Android 程序的初学者,遇到以下错误,尝试过提供的解决方案,例如在模拟器上清除 Google Play 商店数据仍然遇到相同的错误,没有使用任何数据库连接代码,但获取的数据库已泄漏,任何帮助将不胜感激。
Error
03-25 17:16:41.664 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/metrics.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:16:41.669 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/help_responses.db.18' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:16:41.671 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/auto_complete_suggestions.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.080 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/metrics.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.082 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/help_responses.db.18' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.376 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/auto_complete_suggestions.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
Activity A.java
package com.lifecycle.activity.demo.activity_lifecycle;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class ActivityA extends AppCompatActivity {
Button btt;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btt = (Button) findViewById(R.id.button);
btt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(ActivityA.this, ActivityB.class);
startActivity(i);
}
});
Log.i("Activity A","onCreate");
}
@Override
protected void onStart() {
super.onStart();
Log.i("Activity A","onStart");
}
@Override
protected void onResume() {
super.onResume();
Log.i("Activity A","onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.i("Activity A","onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.i("Activity A","onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i("Activity A","onDestroy");
}
@Override
protected void onRestart() {
super.onRestart();
Log.i("Activity A","onRestart");
}
}
ActivityB.java
package com.lifecycle.activity.demo.activity_lifecycle;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
/**
* Created by karthicklove on 25/03/17.
*/
public class ActivityB extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_b);
Log.i("Activity B","onCreate");
}
@Override
protected void onStart() {
super.onStart();
Log.i("Activity B","onStart");
}
@Override
protected void onResume() {
super.onResume();
Log.i("Activity B","onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.i("Activity B","onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.i("Activity B","onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.i("Activity B","onDestroy");
}
@Override
protected void onRestart() {
super.onRestart();
Log.i("Activity B","onRestart");
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.lifecycle.activity.demo.activity_lifecycle.ActivityA">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_name1"
tools:layout_constraintTop_creator="1"
android:layout_marginStart="134dp"
android:layout_marginTop="216dp"
tools:layout_constraintLeft_creator="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginLeft="134dp" />
</android.support.constraint.ConstraintLayout>
activity_b.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/activity_b" />
</LinearLayout>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lifecycle.activity.demo.activity_lifecycle">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ActivityA">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ActivityB"></activity>
</application>
</manifest>
最佳答案
我认为您观察到的不是来自您的应用,而是来自 GMS 服务:
03-25 17:16:41.664 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/metrics.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:16:41.669 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/help_responses.db.18' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:16:41.671 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/auto_complete_suggestions.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.080 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/metrics.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.082 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/help_responses.db.18' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
03-25 17:20:42.376 2335-2344/com.google.android.gms W/SQLiteConnectionPool: A SQLiteConnection object for database '/data/user/0/com.google.android.gms/databases/auto_complete_suggestions.db' was leaked! Please fix your application to end transactions in progress properly and to close the database when it is no longer needed.
如果显示的包来自您的应用程序
com.lifecycle.activity.demo.activity_lifecycle
关于android - 数据库的 SQLiteConnection 对象被泄露,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43016812/
大家晚上好! 在当前的项目中,我遇到了相当令人担忧的内存泄漏,但我似乎无法修复它。 我让应用程序在标准使用情况下运行过夜,当我在 8 小时后醒来时,它消耗了约 750MB 内存,而它一开始的内存约为
class MyViewController: UIViewController { @IBOutlet weak var webView: UIWebView? override
我的 sql 处理程序有问题 A SQLiteConnection object for database '/data/data/.../databases/queueManager' was le
我在引用 block 本身内的“NSBlockOperation”时遇到麻烦。我需要检查操作是否被取消,并且似乎在启用 ARC 的项目中运行时,对“searchOperation”的任何访问都会泄漏。
public class ProgressCircleActivity extends AppCompatActivity { private ProgressDialog progressB
Activity 泄漏是我可以为当前问题想到的最具体的术语。如果有其他情况,请指正。 场景:我创建了一个简单的 Android 测试应用程序来解决我的问题。我有一个 Activity ,一个添加到 f
我正在尝试创建身份验证系统,如果设备关闭 (SCREEN_OFF) 超过 INTERVAL,该系统会弹出登录窗口。 我已经注册了一个 BroadcastReceiver 来监听可启动 Activity
我想知道如果生产 key 被泄露需要采取哪些步骤。幸运的是,情况并非如此,但还是很高兴知道。 特别是,如果简单地将旧 key 交换为新生成的 key ,会发生什么情况?由于它用于生成哈希,是否会破坏整
我正在使用 Leak Canary 来跟踪内存泄漏,它说以下内容被泄漏: static hk.o references ht.a leaks MainActivity instance hk.o 和
-(NSDate *)dateFromDate:(NSDate *)inDate withNewTime:(NSDateComponents *)inTimeComponents { NSCalend
当我使用 AudioToolBox 播放音乐时,内存泄漏严重。 AVAudioPlayer *newMusicPlayer = [[AVAudioPlayer alloc] initWithData:
我使用 OpenAL 在我的应用程序中播放声音。当我使用 Instruments 工具测试它时,它发现了泄漏: LeakedObject = GeneralBlock-512 大小 = 512 字节
我需要捕获桌面图像并处理其 RGB 数据,我正在使用 Quartz API 来执行相同的操作, 我面临的问题是内存使用率高, 请引用函数, 在这里编辑,该函数是通过 pThread 调用的;像这样的东
我的 Android 应用程序中有一个 MapActivity,它使用 osmdroid(Open Street Map for Android 库)显示 map 。 当我在此 MapActivity
我在 fragment 中使用 AdMob。有时我会看到以下堆栈 10-23 14:27:38.916: E/ActivityThread(21250): Activity com.applegrew
我正在使用以下方式访问我的 API key ;这似乎是 recommended way ;但是当我将我的应用程序上传到 Play 管理中心时,运行预发布报告时出现严重错误。它说“泄漏的 GCP API
一家 3rd 方安全咨询公司在我们的 Angular SPA/ASP.NET WebAPI 应用程序中发现了 区域下的风险。信息公开 ,我们被告知要解决。 风险是由于 Angular 应用程序的性质,
在 Android 中,当读取 MIFARE Classic 卡时,使用 MifareClassic.authenticateSectorWithKeyA(或 authenticateSectorWi
加载谷歌地图时在分析器中获取泄漏。我根据谷歌的示例代码创建了一个非常简单的 View Controller ,我发现我在加载 map 时遇到了泄漏。我相信泄漏是在 SDK 本身。有没有人遇到过这个问题
我是一名优秀的程序员,十分优秀!