cubeacon / android-cubeacon-sample

Android Cubeacon Sample Project
12 stars 10 forks source link

Force Close in Start up Demos App #5

Closed radityagumay closed 9 years ago

radityagumay commented 9 years ago

java.lang.NoClassDefFoundError: com.eyro.cubeacon.CBApp.

This error just appears when i going to startup the application from the demos.

alann-maulana commented 9 years ago

Hi @radityagumay

Please download our Cubeacon SDK first at Cubeacon Developer Page. For a complete tutorial about howto setup Cubeacon SDK, you can go to Cubeacon SDK Android Guides page.

Regards.

radityagumay commented 9 years ago

Yes, i already add build path for the sdk. But, it still have a error. I will figure it out, whats happening inside the sdk. I will confirm if works, later..

-----Original Message----- From: "Alann Maulana" notifications@github.com Sent: ‎7/‎7/‎2015 16:09 To: "cubeacon/android-cubeacon-sample" android-cubeacon-sample@noreply.github.com Cc: "radityagumay" gumay.raditya@yahoo.com Subject: Re: [android-cubeacon-sample] Force Close in Start up Demos App (#5)

Hi @radityagumay Please download our Cubeacon SDK first at Cubeacon Developer Page. For a complete tutorial about howto setup Cubeacon SDK, you can go to Cubeacon SDK Android Guides page. Regards. — Reply to this email directly or view it on GitHub.

alann-maulana commented 9 years ago

Hi @radityagumay

For a detailed step-by-step tutorial about howto implement our Cubeacon SDK on an Android project, you can check our video. Or you can subscribe to our Youtube Channel Cubeacon Eyro

Regards.

tio22 commented 9 years ago

hi, i have same problem, why the demoApp project still force close at eclipse?can you help me?

alann-maulana commented 9 years ago

Hi @tio22 ,

Can you post your ADB LOG here??

Regards,

tio22 commented 9 years ago

this, the log cat @alann-maulana 07-29 15:30:06.288: V/Application(1732): Init Cubeacon APP 07-29 15:30:06.343: E/CubeaconSDK(1732): com.eyro.cubeacon.CBApp.setup:236 Cannot find Cubeacon.properties on classpath. 07-29 15:30:06.396: D/AndroidRuntime(1732): Shutting down VM 07-29 15:30:06.451: E/AndroidRuntime(1732): FATAL EXCEPTION: main 07-29 15:30:06.451: E/AndroidRuntime(1732): Process: com.eyro.cubeacon, PID: 1732 07-29 15:30:06.451: E/AndroidRuntime(1732): java.lang.RuntimeException: Unable to create application com.eyro.cubeacon.App: java.lang.RuntimeException: No license found. Please verify you have a Cubeacon.properties file on the classpath. 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4521) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.ActivityThread.access$1500(ActivityThread.java:144) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.os.Handler.dispatchMessage(Handler.java:102) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.os.Looper.loop(Looper.java:135) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.ActivityThread.main(ActivityThread.java:5221) 07-29 15:30:06.451: E/AndroidRuntime(1732): at java.lang.reflect.Method.invoke(Native Method) 07-29 15:30:06.451: E/AndroidRuntime(1732): at java.lang.reflect.Method.invoke(Method.java:372) 07-29 15:30:06.451: E/AndroidRuntime(1732): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 07-29 15:30:06.451: E/AndroidRuntime(1732): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 07-29 15:30:06.451: E/AndroidRuntime(1732): Caused by: java.lang.RuntimeException: No license found. Please verify you have a Cubeacon.properties file on the classpath. 07-29 15:30:06.451: E/AndroidRuntime(1732): at com.eyro.cubeacon.CBConstant.b(SourceFile:270) 07-29 15:30:06.451: E/AndroidRuntime(1732): at com.eyro.cubeacon.CBApp.setup(SourceFile:237) 07-29 15:30:06.451: E/AndroidRuntime(1732): at com.eyro.cubeacon.App.onCreate(App.java:15) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1011) 07-29 15:30:06.451: E/AndroidRuntime(1732): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4518) 07-29 15:30:06.451: E/AndroidRuntime(1732): ... 9 more 07-29 15:30:19.062: I/Process(1732): Sending signal. PID: 1732 SIG: 9

alann-maulana commented 9 years ago

Hi @tio22 ,

Based on this line : 07-29 15:30:06.343: E/CubeaconSDK(1732): com.eyro.cubeacon.CBApp.setup:236 Cannot find Cubeacon.properties on classpath. It is happen because you are not completely setup Cubeacon SDK. You can follow our Cubeacon SDK Installation for a complete guide about howto setup Cubeacon SDK.

Regards.

tio22 commented 9 years ago

Oh , okay i ll try to reinstall the cubeacon sdk.. I will confirm about the progress soon..thanks for your respond alan

radityagumay commented 9 years ago

there is something happened in this

@Override public void onCreate() { super.onCreate(); // Cubeacon SDK Initialization CBApp.setup(this, "Cubeacon.properties"); }

so, i decompile the jar, i found inputstream and, something not working..

then.. use its working (noted i use android studio and eclipse) setup(Context context, java.lang.String cubeaconID, java.lang.String cubeaconKey, java.lang.String kiiAppID, java.lang.String kiiAppKey, java.lang.String kiiSite, boolean ApplyStoryline, boolean CBShowBGAlert, boolean CBShowFGAlert, boolean CBShowAlertOnEnter, boolean CBShowAlertOnExit, java.lang.String CBDefaultAlertTitle, java.lang.String CBDefaultAlertMsg)

alann-maulana commented 9 years ago

@radityagumay ,

Yes, there is another static CBApp#setup method. You can also read on our CBApp class docs.

Regards.

tio22 commented 9 years ago

hi @alann-maulana the app still force close and this the error 07-31 16:12:17.628: I/CubeaconSDK(1078): com.eyro.cubeacon.CBApp.a:732 Preparing for ranging and monitoring service 07-31 16:12:17.644: D/AndroidRuntime(1078): Shutting down VM 07-31 16:12:17.659: E/AndroidRuntime(1078): FATAL EXCEPTION: main 07-31 16:12:17.659: E/AndroidRuntime(1078): Process: com.example.cube, PID: 1078 07-31 16:12:17.659: E/AndroidRuntime(1078): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cube/com.example.cube.MainActivity}: java.lang.IllegalStateException: Foreground is not initialised - invoke at least once with parameterised init/get 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread.access$800(ActivityThread.java:144) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.os.Handler.dispatchMessage(Handler.java:102) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.os.Looper.loop(Looper.java:135) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread.main(ActivityThread.java:5221) 07-31 16:12:17.659: E/AndroidRuntime(1078): at java.lang.reflect.Method.invoke(Native Method) 07-31 16:12:17.659: E/AndroidRuntime(1078): at java.lang.reflect.Method.invoke(Method.java:372) 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 07-31 16:12:17.659: E/AndroidRuntime(1078): Caused by: java.lang.IllegalStateException: Foreground is not initialised - invoke at least once with parameterised init/get 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.eyro.cubeacon.t.a(SourceFile:103) 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.eyro.cubeacon.CBApp.a(SourceFile:733) 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.eyro.cubeacon.CBActivity.onCreate(SourceFile:79) 07-31 16:12:17.659: E/AndroidRuntime(1078): at com.example.cube.MainActivity.onCreate(MainActivity.java:16) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.Activity.performCreate(Activity.java:5937) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) 07-31 16:12:17.659: E/AndroidRuntime(1078): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251) 07-31 16:12:17.659: E/AndroidRuntime(1078): ... 10 more

can you help me, please?

radityagumay commented 9 years ago

hi @tio22 have you initialize the CbApp in Class which extend Application. and last you should register the class in maniffest? which ide you use? if you use android studio. you need to create a module for the jar

regard

tio22 commented 9 years ago

@radityagumay @alann-maulana okay thanks guys i've been solve about force close problem. Another problem now the notification cant come out from the app i am using this code public class MainActivity extends CBActivity { String tag = "MainActivity"; ProgressDialog progress; TextView textDemos; ScrollView main; static NotificationManager notificationManager; static final int NOTIFICATION_ID = 123456; public static final String EXTRA_INTENT = "MESSAGE";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    setContentView(R.layout.activity_main);
    textDemos = (TextView) findViewById(R.id.textDemos);
    main = (ScrollView) findViewById(R.id.main_view);
}

void showNotif(String msg, String brochurePathFile){
    Intent notifyIntent = new Intent(MainActivity.this, BeaconActivity.class);
    notifyIntent.putExtra(MainActivity.EXTRA_INTENT, brochurePathFile);
    notifyIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pendingIntent = PendingIntent.getActivities(
            MainActivity.this,
            0,
            new Intent[]{notifyIntent},
            PendingIntent.FLAG_UPDATE_CURRENT);
    Notification notification = new Notification.Builder(MainActivity.this)
        .setSmallIcon(R.drawable.ic_launcher)
        .setContentTitle("Notify Demo")
        .setContentText(msg)
        .setAutoCancel(true)
        .setContentIntent(pendingIntent)
        .build();
    notification.defaults |= Notification.DEFAULT_SOUND;
    notification.defaults |= Notification.DEFAULT_LIGHTS;
    notificationManager.notify(NOTIFICATION_ID, notification);
}

can you help me ? :)

alann-maulana commented 9 years ago

Hi @tio22 ,

You can show your notification alert when entering or exiting a beacon because it will run on background thread.

Regards.

tio22 commented 9 years ago

Okey @alann thats work thanks for your help..im sorry if OOT :)

radityagumay commented 9 years ago

this issues has solve by applied other approach. More, read in this doc http://docs.cubeacon.com/sdk/android/references/com/eyro/cubeacon/CBApp.html