Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create APK #99

Open
Alkene opened this issue Dec 27, 2017 · 4 comments
Open

Can't create APK #99

Alkene opened this issue Dec 27, 2017 · 4 comments

Comments

@Alkene
Copy link

Alkene commented Dec 27, 2017

When I try and compile the code and build an APK using Android Studio 3.0.1, I get a error message:
Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
If I increase the gradle version to 2.3.2 as seen on this website:
https://stackoverflow.com/questions/44546849/unsupported-method-baseconfig-getapplicationidsuffix
I can get it to compile, but the app crashes immediately when I try and run the build on my phone. Any suggestions?

@AdrianLxM
Copy link
Collaborator

With those changes it compiles and does not crash for me: #100

@seittenj
Copy link

seittenj commented Feb 7, 2018

Hi, did you get it working? I'm using studio3 branch but APK is crashing every time at the beginning. I can compile it succesfully. Same result in emulator and in Hardware. Just wondering if there is something wrong in my android studio& setup in general.

@Alkene
Copy link
Author

Alkene commented Feb 7, 2018

Kind of. After AdrianLxM made the changes I'm able to make a signed APK and install it separate from Android Studio, (via email it to myself and open) and it will run on my phone. But if I try and use USB to put it on phone to use debugging or what not, it crashes every time either in the emulator or by phone. I was able to enter the debugger on my watch by enabling debugging by wifi though. Just can't get into the debugger for the code that is run on the phone.

@seittenj
Copy link

seittenj commented Feb 7, 2018

I was able to get my own APK working after disabling "Instant run". If instant run was enabled, I got following error:
02-08 00:59:03.843 9771-9771/com.dexdrip.stephenblack.nightwatch E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dexdrip.stephenblack.nightwatch, PID: 9771
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dexdrip.stephenblack.nightwatch/com.dexdrip.stephenblack.nightwatch.activities.Home}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2785)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.activeandroid.TableInfo.getIdName()' on a null object reference
at com.activeandroid.Model.(Unknown Source)
at com.dexdrip.stephenblack.nightwatch.alerts.AlertType.(AlertType.java:0)
at com.dexdrip.stephenblack.nightwatch.alerts.AlertType.add_alert(AlertType.java:220)
at com.dexdrip.stephenblack.nightwatch.utils.IdempotentMigrations.migrateBGAlerts(IdempotentMigrations.java:46)
at com.dexdrip.stephenblack.nightwatch.utils.IdempotentMigrations.performAll(IdempotentMigrations.java:24)
at com.dexdrip.stephenblack.nightwatch.activities.Home.onCreate(Home.java:78)
at android.app.Activity.performCreate(Activity.java:6847)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2785) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1532) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:163) 
at android.app.ActivityThread.main(ActivityThread.java:6342) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants