You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling to install correctly the plugin. The only thing I didn't succeed from the setup is this part:
Then on your MainActivity.class file you will need to import and register the plugin in your onCreate method: @Override public void onCreate(Bundle savedInstanceState) { registerPlugin(CapacitorGameConnectPlugin.class); super.onCreate(savedInstanceState); }
Do I have to put it in android/app/src/main/java/io/ionic/start/MainActivity.java ?
I tried like this:
`
package app.myapp.www;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity { @OverRide
public void onCreate(Bundle savedInstanceState) {
registerPlugin(CapacitorGameConnectPlugin.class);
super.onCreate(savedInstanceState);
}
}
`
But when I run it to my android device it returns me this error:
symbol: class Bundle [capacitor] location: class MainActivity [capacitor] C:\Users\alexi\OneDrive\...\android\app\src\main\java\io\ionic\starter\MainActivity.java:8: error: cannot find symbol [capacitor] registerPlugin(CapacitorGameConnectPlugin.class); [capacitor] ^ [capacitor] symbol: class CapacitorGameConnectPlugin [capacitor] location: class MainActivity [capacitor] 2 errors [capacitor] [capacitor] FAILURE: Build failed with an exception.
Also without that part I succeed to run it on my phone but when I try to signIn as follows:
import { CapacitorGameConnect } from '@openforge/capacitor-game-connect'; ... const user = await CapacitorGameConnect.signIn();
It returns me this error in the inspector console:
`
ERROR Error: 4:
at returnResult (VM3:912:32)
at win.androidBridge.onmessage (VM3:887:21)
handleError @ main.2b90b40a20af0514.js:1
`
Please help me finish the setup, I don't know what the "Error 4" means and how to "register the plugin in your onCreate method". 🙏
The text was updated successfully, but these errors were encountered:
Sulorb
changed the title
Configuration MainActivity.class issue
Configuration MainActivity.class issue / Error 4
Apr 7, 2024
I think my message was a bit confusing, but basically I had the common "error 4". Just solved it, here is what I did, maybe it'll help someone here:
In the strings.xml, i wrognly put my package id instead of my game project id (that you'll find under your project name in the google play console): <string translatable="false" name="game_services_project_id"> 0123456789</string>
I noticed you can easily debug directly your app by putting a SHA1 from the debug keystore and it'll work directly:
To get the debug certificate fingerprint, run the following command:
keytool -list -keystore -v
Note: On Windows, the debug keystore is located at C:\Users<USERNAME>.android\debug.keystore. On Mac or Linux, the debug keystore is typically located at ~/.android/debug.keystore.
I will have to change this SHA1 once the app is available in the Store, but you can at least debug your app with this debut keystore.
Hello,
I'm struggling to install correctly the plugin. The only thing I didn't succeed from the setup is this part:
Then on your MainActivity.class file you will need to import and register the plugin in your onCreate method:
@Override public void onCreate(Bundle savedInstanceState) { registerPlugin(CapacitorGameConnectPlugin.class); super.onCreate(savedInstanceState); }
Do I have to put it in android/app/src/main/java/io/ionic/start/MainActivity.java ?
I tried like this:
`
package app.myapp.www;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {
@OverRide
public void onCreate(Bundle savedInstanceState) {
registerPlugin(CapacitorGameConnectPlugin.class);
super.onCreate(savedInstanceState);
}
}
`
But when I run it to my android device it returns me this error:
symbol: class Bundle [capacitor] location: class MainActivity [capacitor] C:\Users\alexi\OneDrive\...\android\app\src\main\java\io\ionic\starter\MainActivity.java:8: error: cannot find symbol [capacitor] registerPlugin(CapacitorGameConnectPlugin.class); [capacitor] ^ [capacitor] symbol: class CapacitorGameConnectPlugin [capacitor] location: class MainActivity [capacitor] 2 errors [capacitor] [capacitor] FAILURE: Build failed with an exception.
Also without that part I succeed to run it on my phone but when I try to signIn as follows:
import { CapacitorGameConnect } from '@openforge/capacitor-game-connect'; ... const user = await CapacitorGameConnect.signIn();
`
ERROR Error: 4:
at returnResult (VM3:912:32)
at win.androidBridge.onmessage (VM3:887:21)
handleError @ main.2b90b40a20af0514.js:1
`
Please help me finish the setup, I don't know what the "Error 4" means and how to "register the plugin in your onCreate method". 🙏
The text was updated successfully, but these errors were encountered: