Android Question Application Unfortunately Stopped

hasanaydin52

Member
Licensed User
Longtime User
Hi,

I worked hard since a week. I read a lot of web pages but i can't solve.

My application has #additionaljar.

i am calling java methods with JAVAOBJECT and #IF JAVA scripts.

Application worked properly on Emulator 7.0 Nougat without error but emulator 6.0 and below occured unfortunately stopped error.

My real devices are 4.4.2 and another one is 6.01 .
Application Unfortunately Stopped on real devices too. (I have no real device with 7.0 Nougat )
Testing debug and release modes.

What should i do?

My Application:
B4A 6.31
tried manifesto: <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"/>

SetApplicationAttribute(android:largeHeap,"true")
starter service/application_error is return true.

javac.exe: ...\jdk1.8.0_60\...
android.jar: ...\android-23\..

Error Log:
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:108)
at b4a.example.main.access$000(main.java:23)
at b4a.example.main$WaitForLayout.run(main.java:86)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7331)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String[] net.zemberek.yapi.kok.KokOzelDurumBilgisi.ozelDurumUygula(net.zemberek.yapi.Kok)' on a null object reference
at net.zemberek.bilgi.kokler.AgacSozluk.ekle(AgacSozluk.java:131)
at net.zemberek.bilgi.kokler.AgacSozluk.<init>(AgacSozluk.java:73)
at net.zemberek.yapi.TurkceDilBilgisi.kokler(TurkceDilBilgisi.java:198)
at net.zemberek.erisim.Zemberek.initialize(Zemberek.java:93)
at net.zemberek.erisim.Zemberek.<init>(Zemberek.java:75)
at b4a.example.main.AndroidKok(main.java:461)
... 20 more
** Activity (main) Resume **




Application is attached below. Jar file addres is http://www.java2s.com/Code/JarDownload/zemberek/zemberek-tum-2.0.jar.zip
 

Attachments

  • MyApp.zip
    2.7 KB · Views: 192
Last edited:

hasanaydin52

Member
Licensed User
Longtime User
This code from Zemberek Project team. It's opensource.
My code properly worked on eclipse java project.

Below code is detailed sample.

B4X:
package net.zemberek.kullanim;

import static java.lang.System.out;

import java.util.Arrays;
import java.util.List;

import net.zemberek.erisim.Zemberek;
import net.zemberek.tr.yapi.TurkiyeTurkcesi;
import net.zemberek.yapi.Kelime;
import net.zemberek.yapi.Kok;
import net.zemberek.yapi.KelimeTipi;

public class ZemberekDeneme {

    public static void main(String[] args) {

        // create Zemberek
        Zemberek zemberek = new Zemberek(new TurkiyeTurkcesi());

        String giris = "kedilerim";
        out.println("Giris:" + giris);

        // control
        if (!zemberek.kelimeDenetle(giris)) {
            out.println(giris + " kelimesi dogru yazilmamis");
            System.exit(1);
        }
        out.println(giris + " kelimesi dogru yazilmis.\n");

        // resolving
        Kelime[] cozumler = zemberek.kelimeCozumle(giris);
        out.println("cozumlemeler:");
        for (Kelime kelime : cozumler)
            System.out.println(kelime);

        //splitting
        out.println("\nayristirma sonuclari:");
        List<String[]> ayrisimlar = zemberek.kelimeAyristir(giris);
        for (String[] strings : ayrisimlar)
            out.println(Arrays.toString(strings));

        //word generate
        Kelime kelime = cozumler[0];
        List<Kok> kokler = zemberek.dilBilgisi().kokler().kokBul("on");
        System.out.println("kokler = " + kokler);
        Kok kok = zemberek.dilBilgisi().kokler().kokBul("koyun", KelimeTipi.ISIM);
        String yeni = zemberek.kelimeUret(kok, kelime.ekler());
        out.println("\nkok degisimi sonrasi yeni kelime: " + yeni);

        //ascii convert
        String asciiGiris = "koyun";
        out.println('\n' + asciiGiris + " icin ascii ayristirma sonuclari:");
        Kelime[] asciiCozumler = zemberek.asciiCozumle(asciiGiris);
        for (Kelime kelime1 : asciiCozumler)
            System.out.println("olasi cozum: " + kelime1);

        //ascii converting to String[]
        out.println("\n 'koyun' icin ascii donusum sonuclari:");
        String[] sonuclar = zemberek.asciidenTurkceye("koyun");
        for (String s : sonuclar)
            System.out.println("olasi cozum: " + s);

        //heceleme.
        String[] heceler = zemberek.hecele(giris);
        out.println("\nheceleme sonucu:" + Arrays.toString(heceler));
    }
}
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…