Thursday, March 27, 2014

ant problem android project package


By ant packaged android project, other issues are resolved, there is my project JNI, standard apk in the root directory has a libs folder, which put the so file, but I can not be so to break into, that My generation has not even libs directory apk solving ah, ant how packed jni. Neighborhoods ah! !
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
android update project-p.
ant debug or ant release
Reply:
cited a floor ilittleone reply:.
android update project-p
ant debug or ant release


Hello I am using the build.xml script to write to ask how to write, you can say something in detail
Reply:
You can then delete the item under build.xml cd your main project < br />Then ant debug or release
Has been so packed. I do not know how you operate
Reply:
reference to the third floor ilittleone reply:
build.xml you can then delete the item under your main project
cdThen ant debug or release
Has been so packed. I do not know how you operate

We must use this build.xml because my purpose is to solve the problem of multi-channel numbers to generate a multiple n apk. So just how can you command convert it into a script, or write scripts
Reply:
You look at your build.xml there is no problem, you first back up the next. Re-use system-generated, if the system does not generate the problem is you have a problem writing build.xml
Build.xml does not need to generate scripts should be written question xml
Reply:
references, 5th Floor ilittleone reply:
you look at your build.xml there is no problem, you first back up the next. Re-use system-generated, if the system does not generate the problem is you have a problem writing build.xml
Build.xml does not need to generate scripts should be written question xml

Only a few lines of script generated by the system, you ant script familiar to you, some people say that this write online, you look
Reply:
  





















But after I added the apk still no libs directory, perhaps my configuration problems, dir is a directory so that files do?
Reply:
This script is written in their own right? This is not clear
Reply:
There is no great God who knows ah, help out
Reply:
reference to the 8th floor ilittleone reply:
This script is written in their own right? This is not clear

Just that issue is resolved, and now encounter a problem, is so packed into apk, we own so no problem, but Baidu map so wrong at the time of loading, third-party jar package no problem, you can normally run, except Baidu map wrong, you know why?

 01-10 14:27:44.983: E / AndroidRuntime (1853): FATAL EXCEPTION: main 
01-10 14:27:44.983: E / AndroidRuntime (1853): java.lang.NullPointerException
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.graphics.Canvas.throwIfRecycled (Canvas.java: 972)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.graphics.Canvas.drawBitmap (Canvas.java: 998)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.MyLocationOverlay.drawCompass (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.MyLocationOverlay.draw (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.ad (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.ab (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.a.onDraw (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6970)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1730)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1730)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1730)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.widget.FrameLayout.draw (FrameLayout.java: 357)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1730)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.widget.FrameLayout.draw (FrameLayout.java: 357)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1730)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.widget.FrameLayout.draw (FrameLayout.java: 357)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.widget.FrameLayout.draw (FrameLayout.java: 357)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.drawChild (ViewGroup.java: 1732)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewGroup.dispatchDraw (ViewGroup.java: 1459)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.View.draw (View.java: 6973)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.widget.FrameLayout.draw (FrameLayout.java: 357)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.android.internal.policy.impl.PhoneWindow $ DecorView.draw (PhoneWindow.java: 1961)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewRoot.draw (ViewRoot.java: 1600)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewRoot.performTraversals (ViewRoot.java: 1321)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.view.ViewRoot.handleMessage (ViewRoot.java: 1957)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.os.Handler.dispatchMessage (Handler.java: 99)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.os.Looper.loop (Looper.java: 143)
01-10 14:27:44.983: E / AndroidRuntime (1853): at android.app.ActivityThread.main (ActivityThread.java: 4263)
01-10 14:27:44.983: E / AndroidRuntime (1853): at java.lang.reflect.Method.invokeNative (Native Method)
01-10 14:27:44.983: E / AndroidRuntime (1853): at java.lang.reflect.Method.invoke (Method.java: 507)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 839)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 597)
01-10 14:27:44.983: E / AndroidRuntime (1853): at dalvik.system.NativeStart.main (Native Method)
01-10 14:32:28.860: E / NetworkLocationProvider (234): releaseCheckLocationLock: wake lock has already been released
01-10 14:32:45.146: E / ActivityManager (120):! Fail to set top app changed

Reply:
at android.graphics.Canvas.throwIfRecycled (Canvas.java: 972)
You recovered bitmap, and then draw the bitmap again, look at the code it
Reply:
at com.baidu.mapapi.MyLocationOverlay.drawCompass (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.MyLocationOverlay.draw (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.ad (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.ab (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.a.onDraw (Unknown Source)
Baidu's jar need to keep you confused?
Reply:
Mmm I look at the code, Baidu map. Jar api itself that is confusing. I have not confused
Reply:
Reply
12th floor ilittleone of references:
at com.baidu.mapapi.MyLocationOverlay.drawCompass (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.MyLocationOverlay.draw (Unknown Source)
01-10 14:27: ......



Solve all the problems:
1 First packaged so the script is this:
 <-! packaged into not visa apk -> 

not packaged into a visa apk ....









<-! Package * so files -.>




Focus is on this sentence


The second issue 2 is due to Baidu map at compile time will want apk's assets directory write many small pictures, then I would not ant to compile, then write those pictures. Solutions from an eclipse in the document compiled apk assets directory is copied to the project directory of all assets, so that you can pack into the ant compile apk.
ok friends. . . This is the end!
Reply:
Reply
12th floor ilittleone of references:
at com.baidu.mapapi.MyLocationOverlay.drawCompass (Unknown Source)
01-10 14:27:44.983: E / AndroidRuntime (1853): at com.baidu.mapapi.MyLocationOverlay.draw (Unknown Source)
01-10 14:27: ......

Thank you very much for your reply, 100 points gives you a
Reply:
The landlord or the good kind, to solve their own problems out that under the scheme, unlike certain people to solve on their own stealth.
I do not know the landlord of the channel in the list of files in it?
I do
If the manifest file:, ant through all the channels, then traverse, here is similar to multidimensional arrays
If the file is not in the list: direct hit unsigned package, and then need to extract, modify the channel number, then packaged in accordance with the apk compression format, signature
Reply:
I have to do is follow this http://blog.csdn.net/tenggangren/article/details/8051937
Reply:
reference to the 16th floor ilittleone reply:
landlord or the good kind, to solve their own problems out and said under the program, unlike certain people to solve their own stealth a.
I do not know the landlord of the channel in the list of files in it?
I do
If the manifest file:, ant through all the channels, then traverse, here is similar to multidimensional arrays
If the file is not in the list: direct hit unsigned package, and then need to extract, modify the channel number, then packaged in accordance with the apk compression format, signature

I have to do is follow this http://blog.csdn.net/tenggangren/article/ details/8051937
Should listen to what you say and the way I like to use regular expressions. I think this should be simpler, and can generate more than one apk, very convenient.
Reply:
reference to the 16th floor ilittleone reply:
landlord or the good kind, to solve their own problems out and said under the program, unlike certain people to solve their own stealth a.
I do not know the landlord of the channel in the list of files in it?
I do
If the manifest file:, ant through all the channels, then traverse, here is similar to multidimensional arrays
If the file is not in the list: direct hit unsigned package, and then need to extract, modify the channel number, then packaged in accordance with the apk compression format, signature

By the way, did you ant to confuse you? I now have to study this, huh
Reply:
ant confuse this part with adt no different, you project the following proguard.config = proguard.cfg open, then configuration, as things may look confusing note proguard official website, third-party jar is best to pay attention to keep out
Reply:
cited 20 floor ilittleone reply:
ant confuse this section with adt no different, you project the following proguard.config = proguard.cfg open, then configuration As for confusing things can look proguard attention to the official website, third-party jar is best to pay attention to keep out

There are complete example
Reply:
cited 20 floor ilittleone reply:
ant confuse this section with adt no different, you project the following proguard.config = proguard.cfg open, then configuration As for confusing things can look proguard attention to the official website, third-party jar is best to pay attention to keep out

I've got a text that confusion, because before adt confusion has been written, the first added just do not know how, on that script do not understand, proguard.config = proguard.cfg specifically how to write the script, you know?
Reply:
 # This is a configuration file for ProGuard. 
# Http://proguard.sourceforge.net/index.html # manual / usage.html

# Optimizations: If you don't want to optimize, use the
# Proguard-android.txt configuration file instead of this one, which
# Turns off the optimization flags. Adding optimization introduces
# Certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn
# Off various optimizations known to have issues, but the list may not
# Be complete or up to date. (The "arithmetic" optimization can be
# Used if you are only targeting Android 2.0 or later.) Make sure you
# Test thoroughly if you go this route.
-Optimizations! Code / simplification / arithmetic,! Code / simplification / cast,! Field / *,! Class / merging / *
-Optimizationpasses 5
-Allowaccessmodification
-Dontpreverify

# The remainder of this file is identical to the non-optimized version
# Of the Proguard configuration file (except that the other file has
# Flags to turn off optimization).

-Dontusemixedcaseclassnames
-Dontskipnonpubliclibraryclasses
-Verbose

-Keepattributes * Annotation *
-Keep public class com.google.vending.licensing.ILicensingService
-Keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html # native
-Keepclasseswithmembernames class * {
native ;
}

# Keep setters in Views so that animations can still work.
# See http://proguard.sourceforge.net/manual/examples.html # beans
-Keepclassmembers public class * extends android.view.View {
void set * (***);
*** Get * ();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick
-Keepclassmembers class * extends android.app.Activity {
public void * (android.view.View);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html # enumerations
-Keepclassmembers enum * {
public static ** [] values ​​();
public static ** valueOf (java.lang.String);
}

-Keep class * implements android.os.Parcelable {
public static final android.os.Parcelable $ Creator *;
}

-Keepclassmembers class **. R $ * {
public static ;
} I want to say that you can not keep

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# Platform version. We know about them, and they are safe.
-Dontwarn android.support. **



http://proguard.sourceforge.net/index.html # manual / examples.html

Basic is like this, you see the specific code, and generally do not need a third party jar confusion, reflection, native of all not to be confused
The official can ignore those injar outjar
Reply:
cited 23 floor ilittleone reply:
Java code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 # This is a configuration file for ProGuard # http://progu ......
?.

Thank you for your help, I mean is that I've got this confused with the document, not to be confused what to confuse what is already written, just do not know how to call in build.xml. This you know?
Reply:
This actually did not turn over, the default build file you proguard.config = proguard.cfg open automatically supported under the project, you modify the build I will not share the
Your search sdk in build.xml under under proguard obfuscate label in place, there are a bunch of things, their research under the bar, watching the dizziness
Reply:
reference to the 25th floor ilittleone reply:
this actually did not turn over, the default build file you proguard.config = proguard.cfg open automatically supported under the project , you modify the build I will not share the
Your search sdk in build.xml under under proguard obfuscate label in place, there are a bunch of things, their research under the bar, watching the dizziness

Mmm I look, thank you
Reply:
Third-party jar package resource file how to break into, ah,,, I have not hit enter. . When calling a method of third-party jar package said resource can not be found. . .
Reply:
Landlord in it. . I also encountered the same problem, as you say all the documents assets directory files are copied to the project folder assets went inside. . But Baidu map or use is not a bird. . A little on the crash. .

Packaged when there is no error, but a lot of warnings about Baidu map. . Landlord encountered? ?
I have a short excerpt. . See the help analyze trouble. . Get a long time, did not solve. . Before a high moral map, with the landlord of your solution.

But this Baidu map on how to do it? Is this jar package baidumapapi_v2_1_3.jar
Baidu map
 [apply] warning: Ignoring InnerClasses attribute for an anonymous inner class 
[Apply] (com.baidu.location.g $ 1) that doesn't come with an
[Apply] associated EnclosingMethod attribute. This class was probably produced by a
[Apply] compiler that did not target the modern. Class file format. The recommended
[Apply] solution is to recompile the class from source, using an up-to-date compiler
[Apply] and without specifying any "-target" type options. The consequence of ignoring
[Apply] this warning is that reflective operations on this class will incorrectly
[Apply] indicate that it is * not * an inner class.
[Apply] warning: Ignoring InnerClasses attribute for an anonymous inner class
[Apply] (com.baidu.location.g $ 2) that doesn't come with an
[Apply] associated EnclosingMethod attribute. This class was probably produced by a
[Apply] compiler that did not target the modern. Class file format. The recommended
[Apply] solution is to recompile the class from source, using an up-to-date compiler
[Apply] and without specifying any "-target" type options. The consequence of ignoring
[Apply] this warning is that reflective operations on this class will incorrectly
[Apply] indicate that it is * not * an inner class.

No comments:

Post a Comment