Codenameone in-app purchase for J2me - java-me

I have implemented one app for s40 (Asha) using CodenameOne SDK, I want to implement In app Purchase for it (Nokia S40) but when I use Nokia_in-app_payment library and compile it so it give error below is mentioned error, could anybody please tell me how can I do it. Thanks in advance.
/*
**Executing: javac -source 5 -target 1.5 -classpath /tmp/build1853819559696327916xxx/tmpclasses:/home/ec2-user/j2me/midpapis.jar -d /tmp/build1853819559696327916xxx/tmpclasses /tmp/build1853819559696327916xxx/tmpsrc/MinerwaStub.java warning: [options] bootstrap class path not set in conjunction with -source 1.5
Note: /tmp/build1853819559696327916xxx/tmpsrc/MinerwaStub.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 warning
Executing: java -jar /home/ec2-user/j2me/proguard.jar -injars . -libraryjars /home/ec2-user/j2me/midpapis.jar:/home/ec2-user/j2me/CLDC11.jar -outjars /tmp/build1853819559696327916xxx/result/Minerwa.jar -target 1.3 -keep public class ** extends javax.microedition.midlet.MIDlet { public *; } -defaultpackage '' -printmapping /tmp/build1853819559696327916xxx/result/obfuscation_mapping.txt -overloadaggressively -dontusemixedcaseclassnames -useuniqueclassmembernames -dontoptimize ProGuard, version 4.7
Reading program directory [/tmp/build1853819559696327916xxx/tmpclasses]
Reading library jar [/home/ec2-user/j2me/midpapis.jar]
Reading library jar [/home/ec2-user/j2me/CLDC11.jar]
Note: duplicate definition of library class [java.io.ByteArrayInputStream]
Note: duplicate definition of library class [java.io.ByteArrayOutputStream]
Note: duplicate definition of library class [java.io.DataInput]
Note: duplicate definition of library class [java.io.DataInputStream]
Note: duplicate definition of library class [java.io.DataOutput]
Note: duplicate definition of library class [java.io.DataOutputStream]
Note: duplicate definition of library class [java.io.EOFException]
Note: duplicate definition of library class [java.io.IOException]
Note: duplicate definition of library class [java.io.InputStream]
Note: duplicate definition of library class [java.io.InputStreamReader]
Note: duplicate definition of library class [java.io.InterruptedIOException]
Note: duplicate definition of library class [java.io.OutputStream]
Note: duplicate definition of library class [java.io.OutputStreamWriter]
Note: duplicate definition of library class [java.io.PrintStream]
Note: duplicate definition of library class [java.io.Reader]
Note: duplicate definition of library class [java.io.UTFDataFormatException]
Note: duplicate definition of library class [java.io.UnsupportedEncodingException]
Note: duplicate definition of library class [java.io.Writer]
Note: duplicate definition of library class [java.lang.ArithmeticException]
Note: duplicate definition of library class [java.lang.ArrayIndexOutOfBoundsException]
Note: duplicate definition of library class [java.lang.ArrayStoreException]
Note: duplicate definition of library class [java.lang.Boolean]
Note: duplicate definition of library class [java.lang.Byte]
Note: duplicate definition of library class [java.lang.Character]
Note: duplicate definition of library class [java.lang.Class]
Note: duplicate definition of library class [java.lang.ClassCastException]
Note: duplicate definition of library class [java.lang.ClassNotFoundException]
Note: duplicate definition of library class [java.lang.Double]
Note: duplicate definition of library class [java.lang.Error]
Note: duplicate definition of library class [java.lang.Exception]
Note: duplicate definition of library class [java.lang.Float]
Note: duplicate definition of library class [java.lang.IllegalAccessException]
Note: duplicate definition of library class [java.lang.IllegalArgumentException]
Note: duplicate definition of library class [java.lang.IllegalMonitorStateException]
Note: duplicate definition of library class [java.lang.IllegalStateException]
Note: duplicate definition of library class [java.lang.IllegalThreadStateException]
Note: duplicate definition of library class [java.lang.IndexOutOfBoundsException]
Note: duplicate definition of library class [java.lang.InstantiationException]
Note: duplicate definition of library class [java.lang.Integer]
Note: duplicate definition of library class [java.lang.InterruptedException]
Note: duplicate definition of library class [java.lang.Long]
Note: duplicate definition of library class [java.lang.Math]
Note: duplicate definition of library class [java.lang.NegativeArraySizeException]
Note: duplicate definition of library class [java.lang.NoClassDefFoundError]
Note: duplicate definition of library class [java.lang.NullPointerException]
Note: duplicate definition of library class [java.lang.NumberFormatException]
Note: duplicate definition of library class [java.lang.Object]
Note: duplicate definition of library class [java.lang.OutOfMemoryError]
Note: duplicate definition of library class [java.lang.Runnable]
Note: duplicate definition of library class [java.lang.Runtime]
Note: duplicate definition of library class [java.lang.RuntimeException]
Note: duplicate definition of library class [java.lang.SecurityException]
Note: duplicate definition of library class [java.lang.Short]
Note: duplicate definition of library class [java.lang.String]
Note: duplicate definition of library class [java.lang.StringBuffer]
Note: duplicate definition of library class [java.lang.StringIndexOutOfBoundsException]
Note: duplicate definition of library class [java.lang.System]
Note: duplicate definition of library class [java.lang.Thread]
Note: duplicate definition of library class [java.lang.Throwable]
Note: duplicate definition of library class [java.lang.VirtualMachineError]
Note: duplicate definition of library class [java.lang.ref.Reference]
Note: duplicate definition of library class [java.lang.ref.WeakReference]
Note: duplicate definition of library class [java.util.Calendar]
Note: duplicate definition of library class [java.util.Date]
Note: duplicate definition of library class [java.util.EmptyStackException]
Note: duplicate definition of library class [java.util.Enumeration]
Note: duplicate definition of library class [java.util.Hashtable]
Note: duplicate definition of library class [java.util.NoSuchElementException]
Note: duplicate definition of library class [java.util.Random]
Note: duplicate definition of library class [java.util.Stack]
Note: duplicate definition of library class [java.util.TimeZone]
Note: duplicate definition of library class [java.util.Timer]
Note: duplicate definition of library class [java.util.TimerTask]
Note: duplicate definition of library class [java.util.Vector]
Note: there were 74 duplicate class definitions.
Warning: com.mobifusion.minerwa.HomePage: can't find superclass or interface com.nokia.payment.NPayListener
Warning: com.mobifusion.minerwa.HomePage: can't find referenced class com.nokia.payment.NPayListener
Warning: com.mobifusion.minerwa.HomePage: can't find referenced class com.nokia.payment.PurchaseData
Warning: com.mobifusion.minerwa.HomePage: can't find referenced class com.nokia.payment.PurchaseData
Warning: com.mobifusion.minerwa.HomePage: can't find referenced class com.nokia.payment.ProductData
Warning: com.mobifusion.minerwa.HomePage: can't find referenced class com.nokia.payment.ProductData
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.siemens.mp.game.Light
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.motorola.phonebook.PhoneBookRecord
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.nokia.mid.ui.FullCanvas
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class net.rim.device.api.system.Application
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.mot.iden.util.Base64
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class mmpp.media.MediaPlayer
Note: there were 6 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
Warning: there were 6 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars').
Error: Please correct the above warnings first.**
*/
Thanks,
Shailendra Gautam

You will need to set the build argument j2me.obfuscation=false and obfuscate on your own with the Nokia libraries.

Related

java.lang.IllegalAccessException: class com.sleepycat.je.utilint.JVMSystemUtils cannot access class sun.management.BaseOperatingSystemImp

java.lang.IllegalAccessException: class com.sleepycat.je.utilint.JVMSystemUtils cannot access class sun.management.BaseOperatingSystemImpl (in module java.management) because module java.management does
not export sun.management to unnamed module
Is there a workarround for this error? I could not find any solution to this problem.
I have all the dependencies. But i could not understand what seems to be the issue here.

Android Studio gradle release Build taking infinite time

I recently updated my code base to Androidx and now trying to build production variant using the command
> ./gradlew assembleProduction
It keeps on building at the process transformClassesAndResourcesWithProguardForProductionRelease
Here is the output
Note: com.google.android.gms.measurement.internal.zzgp: can't find dynamically referenced class com.google.android.gms.tagmanager.TagManagerService
Note: com.google.android.gms.measurement.internal.zzs: can't find dynamically referenced class android.os.SystemProperties
Note: com.google.android.youtube.player.internal.aa: can't find dynamically referenced class com.google.android.youtube.api.locallylinked.LocallyLinkedFactory
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
Note: com.squareup.okhttp.internal.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: io.fabric.sdk.android.FabricKitsFinder: can't find dynamically referenced class com.google.android.gms.ads.AdView
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE8PlatformImplementations
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class kotlin.internal.JRE7PlatformImplementations
Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard$Companion: can't find dynamically referenced class dalvik.system.CloseGuard
Note: okhttp3.internal.platform.AndroidPlatform$Companion: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
Note: okhttp3.internal.platform.AndroidPlatform$Companion: can't find dynamically referenced class com.android.org.conscrypt.OpenSSLSocketImpl
Note: okhttp3.internal.platform.ConscryptPlatform$Companion: can't find dynamically referenced class org.conscrypt.Conscrypt$Version
Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
Note: the configuration refers to the unknown field 'com.google.android.gms.common.api.internal.BasePendingResult$ReleasableResultGuardian mResultGuardian' in class 'com.google.android.gms.common.api.internal.BasePendingResult'
Note: the configuration refers to the unknown method 'com.android.vending.billing.IInAppBillingService asInterface(android.os.IBinder)' in class 'com.android.vending.billing.IInAppBillingService'
Note: the configuration refers to the unknown method 'com.google.android.gms.measurement.AppMeasurement getInstance(android.content.Context,java.lang.String,java.lang.String)' in class 'com.google.android.gms.measurement.AppMeasurement'
Note: the configuration explicitly specifies 'sun.misc.Unsafe' to keep library class 'sun.misc.Unsafe'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParser'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserException'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlPullParserFactory'
Note: the configuration explicitly specifies 'org.xmlpull.v1.**' to keep library class 'org.xmlpull.v1.XmlSerializer'
Note: the configuration explicitly specifies 'android.widget.Space' to keep library class 'android.widget.Space'
Note: there were 7 references to unknown classes.
You should check your configuration for typos.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
Note: there were 3 references to unknown class members.
You should check your configuration for typos.
Note: there were 6 library classes explicitly being kept.
You don't need to keep library classes; they are already left unchanged.
(http://proguard.sourceforge.net/manual/troubleshooting.html#libraryclass)
Note: there were 49 unresolved dynamic references to classes or interfaces.
You should check if you need to specify additional program jars.
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
Note: there were 1 class casts of dynamically created class instances.
You might consider explicitly keeping the mentioned classes and/or
their implementations (using '-keep').
(http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclasscast)
Ignoring unused library classes...
Original number of library classes: 24139
Final number of library classes: 2071
Printing kept classes, fields, and methods...
Inlining subroutines...
Shrinking...
Printing usage to [/Users/harsh/git/Mobile_Android_MVA/app/build/outputs/mapping/production/release/usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 21242
Final number of program classes: 21242
Optimizing (pass 1/5)...
<=<============-> 99% EXECUTING [14m 57s]
> :app:transformClassesAndResourcesWithProguardForProductionRelease
My gradle.properties looks like this
> org.gradle.jvmargs=-Xmx3096m -XX:MaxPermSize=512m
> -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
>
> org.gradle.parallel=true org.gradle.daemon=true
> # Disables R8 for Android Library modules only. android.enableR8.libraries = false
> # Disables R8 for all modules. android.enableR8 = false android.useAndroidX=true android.enableJetifier=true
>
> org.gradle.configureondemand=true
I am using proguard and release buildType has following
minifyEnabled true
useProguard true
shrinkResources true
zipAlignEnabled true
debuggable false
I tried with and without androidx proguard but same result
-keep class androidx.appcompat.widget.** { *; }
-dontwarn com.google.android.material.**
-keep class com.google.android.material.** { *; }
-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
Can you please help me how to solve this so I could generate a signed apk
Which version of Android studio are you using? 3.4?
What happens when you compile with R8 instead of Proguard? Sometimes error messages are more explicit.

Does Haxe pickup on typedefs in interfaces and classes?

If I declare a typedef in a class or interface, can classes that import/implement the class/interface use the typedef?
You import a module, which can have a list of typedefs and direct definitions in it(and MUST have one definition with the same name as module). If definition isn't marked as private, it will be imported in your scope and you will be able to use it(with or without namespace).

One class in same package does not bind to JAXB context

Using JAXBContext.newInstance("com.jaxbgen") to bind classes in this package.
And then use this context to create mashaller.
It's so strange that one entity class xxx in this package could not mashaller, and throw JAXBException nor any of its super class is known to this context.
And the other works well.
I try to use JAXBContext.newInstance(xxx.class) to initial the context, it works well.
But I need to use package name to mashaller all classed in this package.
Could anyone help me on it?
When the package name is used to create a JAXBContext the JAXB impl does one of the following:
Looks for a class called ObjectFactory and then transitively pulls in all reference ed classes.
Looks for a text file called jaxb.index which contains a carriage return separated list of short class names (not package qualified). These classes and all referenced classes are the processed.

Conflict in namespace in C#

If my namespace is
Cytel.GlobalSettings.ChartSetting
and
I have a static class ChartSetting
packed in dll.
then when I use ChartSetting class in other project it shows red color with Chartsetting class's method and public members are not shown
It is interpreting your reference to ChartSetting as a reference to the namespace. You should use the fully qualified name of the ChartSetting static class. If it has an empty namespace, then you will need to use the global qualifier thus:
global::ChartSetting
You can also specify an alias to this class:
using MyAlias = global::ChartSetting;

Resources