1

プロジェクトに jar を含めます。jarをlibsフォルダーに入れました。次に、ビルドパスに追加します。デバイスでプロジェクトを実行すると、正常に動作します。しかし、署名するとクラッシュします。だったと思いproguardます。

jar そのものをプログラムしたくない場合は、どうすればproguard-project.txt.

jar は amazon モバイル広告 jar です。https://developer.amazon.com/sdk/mobileads.html

========編集=============

04-26 23:13:07.973: E/AndroidRuntime(25405): FATAL EXCEPTION: main
04-26 23:13:07.973: E/AndroidRuntime(25405): android.view.InflateException: Binary XML file line #9: Error inflating class com.amazon.device.ads.AdLayout
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.vtube.app.VideoGridviewAdapter.createViewFromResource(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.vtube.app.VideoGridviewAdapter.getView(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.vtube.component.ListToGridAdapter.bindView(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.vtube.component.ListToGridAdapter.bindGridView(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.vtube.component.ListToGridAdapter.getView(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.AbsListView.obtainView(AbsListView.java:2043)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.ListView.makeAndAddView(ListView.java:1772)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.ListView.fillDown(ListView.java:672)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.ListView.fillSpecific(ListView.java:1330)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.ListView.layoutChildren(ListView.java:1603)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.AbsListView.onLayout(AbsListView.java:1873)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.View.layout(View.java:11307)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewGroup.layout(ViewGroup.java:4224)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1501)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2462)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.os.Looper.loop(Looper.java:137)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.app.ActivityThread.main(ActivityThread.java:4560)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at java.lang.reflect.Method.invokeNative(Native Method)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at java.lang.reflect.Method.invoke(Method.java:511)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at dalvik.system.NativeStart.main(Native Method)
04-26 23:13:07.973: E/AndroidRuntime(25405): Caused by: java.lang.reflect.InvocationTargetException
04-26 23:13:07.973: E/AndroidRuntime(25405):    at java.lang.reflect.Constructor.constructNative(Native Method)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.view.LayoutInflater.createView(LayoutInflater.java:586)
04-26 23:13:07.973: E/AndroidRuntime(25405):    ... 50 more
04-26 23:13:07.973: E/AndroidRuntime(25405): Caused by: java.lang.ArrayIndexOutOfBoundsException: length=390; index=-6
04-26 23:13:07.973: E/AndroidRuntime(25405):    at android.content.res.TypedArray.getString(TypedArray.java:120)
04-26 23:13:07.973: E/AndroidRuntime(25405):    at com.amazon.device.ads.AdLayout.<init>(Unknown Source)
04-26 23:13:07.973: E/AndroidRuntime(25405):    ... 53 more

この FC は、署名されている場合にのみ発生します。だから私はそれがプロガードの問題だと思います。cause by部分は にありamazon ad jarます。

私はたくさん入れkeepましたproguard-project.txt

-dontoptimize

-keep class com.amazon.device.ads.** { *; }

-dontwarn com.amazon.**
-keep class com.amazon.** {*;}
-keepattributes *Annotation*

-keepclassmembers class com.amazon.** {*;}
-keepclassmembernames class com.amazon.** {*;}

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembernames class * {
     public <init>(android.content.Context, android.util.AttributeSet); 
}

-keepclasseswithmembernames class * {
     public <init>(android.content.Context, android.util.AttributeSet, int); 
 }
4

1 に答える 1

1

プロガードの実行をカスタマイズできます。よくわかりませんが、こんな感じで覚えています。

サンプル: http://proguard.sourceforge.net/index.html#manual/examples.html

例:

-injars       myapplication.jar
-outjars      myapplication_out.jar
-libraryjars  <java.home>/lib/rt.jar
-printmapping myapplication.map

-keep public class mypackage.MyMain {
    public static void main(java.lang.String[]);
}
于 2013-04-26T10:46:37.700 に答える