마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

50mb넘는 앱의 확장파일 다운로드 받으면, 앱이 죽어버려요 ㅠㅠ

0 추천

50mb가 넘어서 확장파일 만들고, 구글 개발자 콘솔에 등록도 마쳤어요.

obb파일이 저장되는 위치에 obb파일 직접 넣어서 테스트도 마쳤구요.

근데 obb파일을 삭제하고 테스트 하니 앱이 죽어버리네요 ㅠㅠ

obb파일이 없을 경우 다운로드하는 로직에 로그를 찍어봤는데.. 제대로 로직을 다 타는거 같은데 앱이 죽어버려요.ㅠㅠ

아래 소스 중 

"다운로드 중..." 로그도 제대로 찍히거든요.

다운로드하는 로직을 제대로 타는 것 같은데 앱이 죽어버리네요.

뭐가 문제인건지,, 아니면 어느 부분을 확인해봐야 하는지 실마리라도 주세요 ㅠㅠ

String mainFileName = Helpers.getExpansionAPKFileName(this, true, 1);
		boolean fileExists = Helpers.doesFileExist(this, mainFileName, 179039558L , false);
		
		if (!fileExists) {
			Intent launcher = getIntent();
			Intent fromNotification = new Intent(this, getClass());
			fromNotification.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
			fromNotification.setAction(launcher.getAction());
			
			if (launcher.getCategories() != null) {
				for (String cat : launcher.getCategories()) {
					
					fromNotification.addCategory(cat);
				}
			}
			PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, fromNotification, PendingIntent.FLAG_UPDATE_CURRENT);
			try {
				// Start the download
				int result = DownloaderClientMarshaller.startDownloadServiceIfRequired(this, pendingIntent, ExpansionFileDownloaderService.class);
				
				if (DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED != result) {
					// implement Downloading UI.
					Log.d("myLog", "다운로드 중...");
					return;
				}
			} catch (NameNotFoundException e) {
				Log.e("apk-expansion-files", "NameNotFoundException occurred. " + e.getMessage(), e);
			}
		}

 

수이 (540 포인트) 님이 2014년 6월 13일 질문

1개의 답변

0 추천
일단 로그캣 주시고요..다운받을때 스레드 정상작동하나요??
YeonMin (17,860 포인트) 님이 2014년 6월 14일 답변
답변 정말 너무너무 감사드립니다! 제가 안드로이드 앱 개발이 처음이라 하나 해결하면 또 하나가 문제고 그러네요.. 산넘어 산이에요ㅠㅠ
다운받을 때 스레드가 정상작동하는지 어떤 부분을 보면 알 수 있나요?
다운받는 로직은 정상적으로 타고 있는 것으로 보이는게..
if (DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED != result) {
                    // implement Downloading UI.
                    Log.d("myLog", "다운로드 중...");
                    return;
}
이 부분 로그가 제대로 찍히긴 하거든요..
이게 말씀하신 다운받을 때 스레드 인지 모르겠네요^^;


로그캣

06-15 14:06:59.594: E/DatabaseUtils(2352): Writing exception to parcel
06-15 14:06:59.594: E/DatabaseUtils(2352): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
06-15 14:06:59.594: E/DatabaseUtils(2352):     at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13308)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at android.os.Binder.execTransact(Binder.java:388)
06-15 14:06:59.594: E/DatabaseUtils(2352):     at dalvik.system.NativeStart.run(Native Method)
06-15 14:07:00.104: E/SQLiteLog(4846): (14) cannot open file at line 32516 of [00bb9c9ce4]
06-15 14:07:00.104: E/SQLiteLog(4846): (14) os_unix.c:32516: (2) open(/NotificationPermissions.db) -
06-15 14:07:00.114: E/SELinux(18564): Function: selinux_android_load_priority [0], There is no sepolicy file
06-15 14:07:00.114: E/SELinux(18564):  
06-15 14:07:00.114: E/SELinux(18564): Function: selinux_android_load_priority [1], There is no sepolicy version file
06-15 14:07:00.114: E/SELinux(18564):  
06-15 14:07:00.114: E/SELinux(18564): Function: selinux_android_load_priority , loading version is VE=SEPF_SHV-E210K_4.3_0018
06-15 14:07:00.114: E/SELinux(18564):  
06-15 14:07:00.114: E/SELinux(18564):  
06-15 14:07:00.114: E/SELinux(18564): selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts
06-15 14:07:00.224: E/gralloc(1950): secureID: 0xd, release error
06-15 14:07:00.374: E/SmartFaceService(2352): onReceive: android.intent.action.CONFIGURATION_CHANGED
06-15 14:07:00.374: E/SmartFaceService(2352): mFolderCoverOpened: (true, true) -> true
06-15 14:07:00.529: E/dalvikvm(18564): Could not find class 'com.google.android.vending.licensing.APKExpansionPolicy', referenced from method com.google.android.vending.expansion.downloader.impl.DownloaderService$LVLRunnable.run
06-15 14:07:00.589: E/(18564): Device driver API match
06-15 14:07:00.589: E/(18564): Device driver API version: 23
06-15 14:07:00.589: E/(18564): User space API version: 23
06-15 14:07:00.589: E/(18564): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Fri Nov 29 14:18:37 KST 2013
06-15 14:07:00.624: E/AndroidRuntime(18564): FATAL EXCEPTION: main
06-15 14:07:00.624: E/AndroidRuntime(18564): java.lang.NoClassDefFoundError: com.android.vending.expansion.downloader.R$string
06-15 14:07:00.624: E/AndroidRuntime(18564):     at com.google.android.vending.expansion.downloader.Helpers.getDownloaderStringResourceIDFromState(Helpers.java:268)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at com.google.android.vending.expansion.downloader.impl.DownloadNotification.onDownloadStateChanged(DownloadNotification.java:106)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at com.google.android.vending.expansion.downloader.impl.DownloaderService$LVLRunnable.run(DownloaderService.java:752)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at android.os.Handler.handleCallback(Handler.java:730)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at android.os.Looper.loop(Looper.java:176)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at android.app.ActivityThread.main(ActivityThread.java:5455)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at java.lang.reflect.Method.invokeNative(Native Method)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at java.lang.reflect.Method.invoke(Method.java:525)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
06-15 14:07:00.624: E/AndroidRuntime(18564):     at dalvik.system.NativeStart.main(Native Method)
06-15 14:07:00.709: A/libc(18564): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 18580 (Thread-9777)
06-15 14:07:01.184: E/gralloc(1950): secure id: 0xd, release error
06-15 14:07:01.199: E/InputDispatcher(2352): channel ~ Channel is unrecoverably broken and will be disposed!
06-15 14:07:01.279: E/gralloc(1950): secureID: 0xd, release error
06-15 14:07:01.359: E/android.os.Debug(2352): !@Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
06-15 14:07:01.449: E/SmartFaceService(2352): onReceive: android.intent.action.CONFIGURATION_CHANGED
06-15 14:07:01.454: E/SmartFaceService(2352): mFolderCoverOpened: (true, true) -> true
06-15 14:07:01.479: E/Launcher(2724): Error finding setting, default accessibility to not found: accessibility_enabled
06-15 14:07:02.134: E/gralloc(1950): secure id: 0xd, release error
06-15 14:07:03.079: E/ViewRootImpl(2352): sendUserActionEvent() mView == null
06-15 14:07:03.084: E/EnterpriseContainerManager(2352): ContainerPolicy Service is not yet ready!!!
...