2013-03-12 10 views
4

APK 파일을 만들려고하지만 내보내기 대화 상자에서 마침을 누르면 오류가 발생하고 APK가 만들어지지 않습니다. 지금까지 인터넷에서 아무 것도 찾을 수 없습니다. 누군가 도움을 줄 수 있습니까? 오류 :Android proguard 오류 com.google.ads.util.i : 및 setMediaPlaybackRequiresUserGesture (부울)

Proguard returned with error code 1. See console 
Warning: com.google.ads.util.i: can't find referenced method 'void setMediaPlaybackRequiresUserGesture(boolean)' in class android.webkit.WebSettings 
     You should check if you need to specify additional program jars. 
Warning: there were 1 unresolved references to program class members. 
     Your input classes appear to be inconsistent. 
     You may need to recompile them and try again. 
     Alternatively, you may have to specify the option 
     '-dontskipnonpubliclibraryclassmembers'. 
java.io.IOException: Please correct the above warnings first. 
    at proguard.Initializer.execute(Initializer.java:321) 
    at proguard.ProGuard.initialize(ProGuard.java:211) 
    at proguard.ProGuard.execute(ProGuard.java:86) 
    at proguard.ProGuard.main(ProGuard.java:492) 

나는

-dontskipnonpubliclibraryclassmembers 

을 추가하려고하지만, 도움이되지 않았다. 광고를 사용하고 있는데, 이것은 일반적인 안드로이드 응용 프로그램입니다. 에뮬레이터에서 잘 작동합니다.

PS

# This file is automatically generated by Android Tools. 
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! 
# 
# This file must be checked in Version Control Systems. 
# 
# To customize properties used by the Ant build system edit 
# "ant.properties", and override values to adapt the script to your 
# project structure. 
# 
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 

# Project target. 
target=android-16 

감사 : 충분히 안전이 기본 안드로이드 난독 설정이 기본 방지 할 수있다

내 proguard.config 빈 기본

# To enable ProGuard in your project, edit project.properties 
# to define the proguard.config property as described in that file. 
# 
# Add project specific ProGuard rules here. 
# By default, the flags in this file are appended to flags specified 
# in ${sdk.dir}/tools/proguard/proguard-android.txt 
# You can edit the include path and order by changing the ProGuard 
# include property in project.properties. 
# 
# For more details, see 
# http://developer.android.com/guide/developing/tools/proguard.html 

# Add any project specific keep options here: 

# If your project uses WebView with JS, uncomment the following 
# and specify the fully qualified class name to the JavaScript interface 
# class: 
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { 
# public *; 
#} 

그리고 내 project.properties입니다 "해킹"? (실행 가능하게 만들 수있는 경우)

답변

10

경고 메시지에서 알 수 있듯이 Google 광고 라이브러리는 대상 런타임 (android-16)에없는 메소드를 참조합니다. 이 방법은 android-17에서만 존재합니다. ProGuard가 메소드를 찾고 코드를 올바르게 분석 할 수 있도록 android-17 이상의 대상을 지정해야합니다.

어쨌든 응용 프로그램이 다른 대상에서 작동하는 경우 AndroidManifest.xml에 다른 대상을 지정할 수 있습니다.

ProGuard는 정적 분석에 대한 몇 가지 기본적인 보호 기능을 제공합니다. 식별자를 난독 화하고 코드 구조를 수정합니다. 보호를 강화하려면 상업용 형제 인 DexGuard을 고려하면 스트링 암호화, 클래스 암호화 및 변조 감지와 같은 기술을 사용하여 정적 분석 및 동적 분석에 대한 보호 기능을 강화할 수 있습니다. 아무것도 깨지기 쉽지 않으므로 궁극적으로 당신과 잠재적 인 해커, 시간, 노력, 돈, 이득, 전문 지식에 대한 경제적 인 트레이드 오프가됩니다 ...

(내가 ProGuard와 DexGuard의 개발자입니다)

+0

와우, 개발자로부터 답장을받지 못했습니다. – Zotyi

+0

감사합니다. 17으로 변경합니다. – Zotyi

1

나는 추가 해결 한 :

-dontwarn com.google.ads.** 

-verbose 후. 예 :

-optimizationpasses 5                       -dontusemixedcaseclassnames              
-dontskipnonpubliclibraryclasses             
-dontpreverify                 
-verbose                   
-dontwarn com.google.ads.**              
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 
... 
+0

나는 - dontwarn com.google. *을 가지고 있었다. 그러나 내가 추천 한 것을하기 전까지는 작동하지 않았다. 나는 왜 그런 단서가 없다.하지만 나는 -dontwarn com.google.ads를 넣어야했다. ** .... thanks – j2emanue