Comments (2)
Did you shade the dependencies? Are you using Gradle or maven? If not you can look on GitHub for the software called Reflections, and use Jitpack.io to grab it for whatever your dependency manager is. Let me know for updates.
from streamelements-java-api.
I'm using maven. Already i have added ur git project. My MainActivity code:
instance = new StreamElementsBuilder() .withAccountID(accoundID) .registerListeners(EventListenerExample.class) .withToken(token) .withConnectionTimeout(10000) .build();
returning error:
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.kam202.streamelements, PID: 9991 java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.runtime/javalib/core-oj.jar) at me.limeglass.streamelements.internals.handlers.ElementsReaderHandler.load(ElementsReaderHandler.java:50) at me.limeglass.streamelements.internals.StreamElementsClient.<init>(StreamElementsClient.java:35) at me.limeglass.streamelements.api.StreamElementsBuilder.build(StreamElementsBuilder.java:110) at com.kam202.streamelements.MainActivity.onCreate(MainActivity.java:40) at android.app.Activity.performCreate(Activity.java:8049) at android.app.Activity.performCreate(Activity.java:8037)
I must increase min api from 19 to 26 becouse I had
MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
So.. what's wrong?
EDIT:
i'm added in build.grandle
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
and in main class
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy);
now im getting
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kam202.streamelements/com.kam202.streamelements.MainActivity}: java.util.NoSuchElementException: No value present at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3752) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3923) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2368) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:8113) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) Caused by: java.util.NoSuchElementException: No value present
Code ^:
Points points = instance.getUserPoints("kam203"); User user = points.getUser(); TextView x = findViewById(R.id.XD); x.setText(user.getName() + " is #" + points.getRank() + " in the leaderboard" + " with " + points.getCurrentPoints() + " points! PogChamp");
and event's like onConnect, on Connection and onAuthenticated not working (none log's in debug)
from streamelements-java-api.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamelements-java-api.